2015-08-26 01:42:46 +00:00
|
|
|
app = Gitlab::Application
|
2015-02-20 11:44:07 +00:00
|
|
|
|
2015-02-21 09:58:11 +00:00
|
|
|
if app.config.serve_static_assets
|
2015-02-20 22:30:06 +00:00
|
|
|
# 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,
|
|
|
|
# except ignoring `/uploads`, letting those go through to the GitLab Rails app.
|
|
|
|
|
2015-02-20 11:44:07 +00:00
|
|
|
app.config.middleware.swap(
|
|
|
|
ActionDispatch::Static,
|
|
|
|
Gitlab::Middleware::Static,
|
|
|
|
app.paths["public"].first,
|
|
|
|
app.config.static_cache_control
|
|
|
|
)
|
2015-02-20 13:39:35 +00:00
|
|
|
end
|