gitlab-org--gitlab-foss/config/initializers/static_files.rb

16 lines
532 B
Ruby
Raw Normal View History

app = Rails.application
if app.config.serve_static_assets
2015-02-20 17:30:06 -05: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.
app.config.middleware.swap(
ActionDispatch::Static,
Gitlab::Middleware::Static,
app.paths["public"].first,
app.config.static_cache_control
)
2015-02-20 08:39:35 -05:00
end