From 4310431ee73fdd6aa3874aaccc0a901252e7f61f Mon Sep 17 00:00:00 2001 From: Douwe Maan Date: Fri, 20 Feb 2015 12:44:07 +0100 Subject: Use modified ActionDispatch::Static to let uploads go through to routes. --- lib/gitlab/middleware/static.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 lib/gitlab/middleware/static.rb (limited to 'lib') 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 -- cgit v1.2.1