Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/config
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2015-02-21 01:30:06 +0300
committerDouwe Maan <douwe@gitlab.com>2015-02-21 01:30:06 +0300
commit6945f4a299d9b46b9896e431086277bfedf54b7d (patch)
treecdc276f173b5bcf794ee57fe3bf3a39fa57fe015 /config
parent08874d2b51e71debac61659050ea577dffd89bf8 (diff)
Explain `Gitlab::Middleware::Static`.
Diffstat (limited to 'config')
-rw-r--r--config/initializers/static_files.rb5
1 files changed, 5 insertions, 0 deletions
diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb
index 2a6eaec0cc4..bc4fe14bc1a 100644
--- a/config/initializers/static_files.rb
+++ b/config/initializers/static_files.rb
@@ -1,6 +1,11 @@
begin
app = Rails.application
+ # 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,