diff options
author | Francis Irving <francis@mysociety.org> | 2010-09-16 02:04:06 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-09-16 02:04:06 +0100 |
commit | eb14e07eaee3f30b3bbadd06b9e99c0e11ba88bb (patch) | |
tree | 7663a320f3489901008bbcc151e0cbd9ad97cb4b /config/environment.rb | |
parent | a690d47e205b30f641e89f6a7f7c613a02c1b6af (diff) |
Serve CSS from secure URL for admin
Diffstat (limited to 'config/environment.rb')
-rw-r--r-- | config/environment.rb | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/config/environment.rb b/config/environment.rb index 5b632471e..e02a11e49 100644 --- a/config/environment.rb +++ b/config/environment.rb @@ -96,7 +96,13 @@ ActionMailer::Base.default_url_options[:host] = MySociety::Config.get("DOMAIN", # So that javascript assets use full URL, so proxied admin URLs read javascript OK if (MySociety::Config.get("DOMAIN", "") != "") - ActionController::Base.asset_host = MySociety::Config.get("DOMAIN", 'localhost:3000') + ActionController::Base.asset_host = Proc.new { |source, request| + if request.ssl? # for mySociety proxying + MySociety::Config.get("ADMIN_PUBLIC_URL", "/") + else + MySociety::Config.get("DOMAIN", 'localhost:3000') + end + } end # Load monkey patches from lib/ |