diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-02-20 14:44:07 +0300 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-02-20 14:44:07 +0300 |
commit | 4310431ee73fdd6aa3874aaccc0a901252e7f61f (patch) | |
tree | 97065a9c0862ccd467b3f8e6789922731b68804f /config/initializers/static_files.rb | |
parent | eb210f4a1876f0dbf70b8c3ae855b6a986777421 (diff) |
Use modified ActionDispatch::Static to let uploads go through to routes.
Diffstat (limited to 'config/initializers/static_files.rb')
-rw-r--r-- | config/initializers/static_files.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/initializers/static_files.rb b/config/initializers/static_files.rb new file mode 100644 index 00000000000..e04c29cee4a --- /dev/null +++ b/config/initializers/static_files.rb @@ -0,0 +1,13 @@ +begin + app = Rails.application + + app.config.middleware.swap( + ActionDispatch::Static, + Gitlab::Middleware::Static, + app.paths["public"].first, + app.config.static_cache_control + ) +rescue + # If ActionDispatch::Static wasn't loaded onto the stack (like in production), + # an exception is raised. +end
\ No newline at end of file |