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
This commit is contained in:
Marin Jankovski 2015-02-21 17:50:03 +00:00
commit 829d72d30a

View file

@ -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