From ccac5c96a02f7d42c1c2dcc6143658c9680f26f4 Mon Sep 17 00:00:00 2001 From: Marin Jankovski Date: Sat, 21 Feb 2015 17:50:03 +0000 Subject: Merge branch 'static-middleware' into 'master' Change check to only swap static middleware when it's enabled. Fixes problem with #1553. cc @marin See merge request !1565 --- config/initializers/static_files.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb index bc4fe14bc1a..d9042c652bb 100644 --- a/config/initializers/static_files.rb +++ b/config/initializers/static_files.rb @@ -1,6 +1,6 @@ -begin - app = Rails.application +app = Rails.application +if app.config.serve_static_assets # The `ActionDispatch::Static` middleware intercepts requests for static files # by checking if they exist in the `/public` directory. # We're replacing it with our `Gitlab::Middleware::Static` that does the same, @@ -12,7 +12,4 @@ begin app.paths["public"].first, app.config.static_cache_control ) -rescue - # If ActionDispatch::Static wasn't loaded onto the stack (like in production), - # an exception is raised. end -- cgit v1.2.3