BigW Consortium Gitlab

static_files.rb 531 Bytes
Newer Older
Valery Sizov committed
1
app = Rails.application
2

3
if app.config.serve_static_files
4 5 6 7 8
  # 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.

9 10 11 12 13 14
  app.config.middleware.swap(
    ActionDispatch::Static, 
    Gitlab::Middleware::Static, 
    app.paths["public"].first, 
    app.config.static_cache_control
  )
Douwe Maan committed
15
end