diff options
author | Douwe Maan <douwe@gitlab.com> | 2015-03-03 13:07:14 +0100 |
---|---|---|
committer | Douwe Maan <douwe@gitlab.com> | 2015-03-04 23:20:47 +0100 |
commit | 516bcabbf42d60db2ac989dce4c7187b2a1e5de9 (patch) | |
tree | bdc504df2af875908fd77ca2ca4fc8d962870207 /lib/gitlab/middleware | |
parent | 2f4656b5c7e2a9b351237432e76a7b928a1684b1 (diff) | |
download | gitlab-ce-516bcabbf42d60db2ac989dce4c7187b2a1e5de9.tar.gz |
Increase timeout for Git-over-HTTP requests.
Diffstat (limited to 'lib/gitlab/middleware')
-rw-r--r-- | lib/gitlab/middleware/timeout.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/gitlab/middleware/timeout.rb b/lib/gitlab/middleware/timeout.rb new file mode 100644 index 00000000000..015600392b9 --- /dev/null +++ b/lib/gitlab/middleware/timeout.rb @@ -0,0 +1,13 @@ +module Gitlab + module Middleware + class Timeout < Rack::Timeout + GRACK_REGEX = /[-\/\w\.]+\.git\//.freeze + + def call(env) + return @app.call(env) if env['PATH_INFO'] =~ GRACK_REGEX + + super + end + end + end +end |