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 /lib | |
parent | eb210f4a1876f0dbf70b8c3ae855b6a986777421 (diff) |
Use modified ActionDispatch::Static to let uploads go through to routes.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/gitlab/middleware/static.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/middleware/static.rb b/lib/gitlab/middleware/static.rb new file mode 100644 index 00000000000..b92319c95d4 --- /dev/null +++ b/lib/gitlab/middleware/static.rb @@ -0,0 +1,13 @@ +module Gitlab + module Middleware + class Static < ActionDispatch::Static + UPLOADS_REGEX = /\A\/uploads(\/|\z)/.freeze + + def call(env) + return @app.call(env) if env['PATH_INFO'] =~ UPLOADS_REGEX + + super + end + end + end +end
\ No newline at end of file |