diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-21 12:58:11 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-21 17:09:17 +0300 |
commit | 452ba19cdd8e61fa568e2f6462c14b8f31c4c07b (patch) | |
tree | 4f9f07c2eb13f8a2bdcb7ae49b3ead2f8ce59aed /config | |
parent | a224a655d812d60fa8be45e36922049b313ecb2f (diff) |
Change check to only swap static middleware when it's enabled.
Diffstat (limited to 'config')
-rw-r--r-- | config/initializers/static_files.rb | 7 |
1 files 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 |