aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFrancis Irving <francis@mysociety.org>2010-09-16 02:10:58 +0100
committerFrancis Irving <francis@mysociety.org>2010-09-16 02:10:58 +0100
commit4859bbcaa8a105e8600ec1fa363789b86d116b04 (patch)
tree0f0c5d223aa095deb97bdb652bfedf07cfb28adf
parenteb14e07eaee3f30b3bbadd06b9e99c0e11ba88bb (diff)
Fix up path for assets.
-rw-r--r--config/environment.rb2
-rw-r--r--config/general-example5
2 files changed, 3 insertions, 4 deletions
diff --git a/config/environment.rb b/config/environment.rb
index e02a11e49..5a61d7e56 100644
--- a/config/environment.rb
+++ b/config/environment.rb
@@ -97,7 +97,7 @@ 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 = Proc.new { |source, request|
- if request.ssl? # for mySociety proxying
+ if request.fullpath.match(/^\/admin\//)
MySociety::Config.get("ADMIN_PUBLIC_URL", "/")
else
MySociety::Config.get("DOMAIN", 'localhost:3000')
diff --git a/config/general-example b/config/general-example
index 8b36ef9c8..4a1f88ccc 100644
--- a/config/general-example
+++ b/config/general-example
@@ -38,9 +38,8 @@ define('OPTION_BLACKHOLE_PREFIX', 'do-not-reply-to-this-address'); // used as en
// Administration
define('OPTION_CONTACT_EMAIL', 'admin@localhost');
define('OPTION_ADMIN_BASE_URL', '/admin/');
-// Where /stylesheets sits under for pages served over SSL, see asset_host in
-// config/environment.rb. This is to serve the stylesheets from SSL as well in
-// mySociety's proxied admin system.
+// Where /stylesheets sits under for admin pages. See asset_host in
+// config/environment.rb. Can be full domain or relative path.
define('OPTION_ADMIN_PUBLIC_URL', '/');
// Secret key for signing cookie_store sessions