Commit 48ce80a6 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix issue when developers are able to push to protected branch

When that branch contain a '/' in the branch name.
Fix for git over HTTP
parent 551946a3
...@@ -15,7 +15,7 @@ module Grack ...@@ -15,7 +15,7 @@ module Grack
@auth = Request.new(env) @auth = Request.new(env)
# Need this patch due to the rails mount # Need this patch due to the rails mount
# Need this if under RELATIVE_URL_ROOT # Need this if under RELATIVE_URL_ROOT
unless Gitlab.config.gitlab.relative_url_root.empty? unless Gitlab.config.gitlab.relative_url_root.empty?
# If website is mounted using relative_url_root need to remove it first # If website is mounted using relative_url_root need to remove it first
...@@ -23,7 +23,7 @@ module Grack ...@@ -23,7 +23,7 @@ module Grack
else else
@env['PATH_INFO'] = @request.path @env['PATH_INFO'] = @request.path
end end
@env['SCRIPT_NAME'] = "" @env['SCRIPT_NAME'] = ""
auth! auth!
...@@ -110,7 +110,7 @@ module Grack ...@@ -110,7 +110,7 @@ module Grack
# Need to reset seek point # Need to reset seek point
@request.body.rewind @request.body.rewind
/refs\/heads\/([\w\.-]+)/n.match(input.force_encoding('ascii-8bit')).to_a.last /refs\/heads\/([\/\w\.-]+)/n.match(input.force_encoding('ascii-8bit')).to_a.last
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment