diff options
author | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-12-17 13:18:50 +0200 |
---|---|---|
committer | Ahmad Hassan <ahmad.hassan612@gmail.com> | 2018-12-17 13:18:50 +0200 |
commit | d6886506a0bb8b7db3e6f4fa7dc4d5aa1632b84f (patch) | |
tree | 04b5625a927fb37e684d026cb5161b78f993b72e /config/initializers/static_files.rb | |
parent | dfc54352c001e8544972c3d40bfc82e55a11c6a0 (diff) | |
parent | 32b6129d8cef406b1cafa455fcf0bf83ddba46de (diff) | |
download | gitlab-ce-d6886506a0bb8b7db3e6f4fa7dc4d5aa1632b84f.tar.gz |
Merge remote-tracking branch 'origin/master' into support-gitaly-tls
Diffstat (limited to 'config/initializers/static_files.rb')
-rw-r--r-- | config/initializers/static_files.rb | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb index a0b8b68f3ef..e02f0868e9f 100644 --- a/config/initializers/static_files.rb +++ b/config/initializers/static_files.rb @@ -1,26 +1,17 @@ app = Rails.application -if (Gitlab.rails5? && app.config.public_file_server.enabled) || app.config.serve_static_files +if app.config.public_file_server.enabled # 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. - if Gitlab.rails5? - app.config.middleware.swap( - ActionDispatch::Static, - Gitlab::Middleware::Static, - app.paths["public"].first, - headers: app.config.public_file_server.headers - ) - else - app.config.middleware.swap( - ActionDispatch::Static, - Gitlab::Middleware::Static, - app.paths["public"].first, - app.config.static_cache_control - ) - end + app.config.middleware.swap( + ActionDispatch::Static, + Gitlab::Middleware::Static, + app.paths["public"].first, + headers: app.config.public_file_server.headers + ) # If webpack-dev-server is configured, proxy webpack's public directory # instead of looking for static assets |