diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-26 12:54:57 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-08-26 12:54:57 +0300 |
commit | 48ce80a60c4d80afa555ce511e98102ff5291a31 (patch) | |
tree | 28417d25ca05ab071f3b7d7ff4f450c126b649c2 /lib/gitlab/backend | |
parent | 551946a34e60195c44f293febaa8a0e77f0a23c7 (diff) | |
download | gitlab-ce-48ce80a60c4d80afa555ce511e98102ff5291a31.tar.gz |
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
Diffstat (limited to 'lib/gitlab/backend')
-rw-r--r-- | lib/gitlab/backend/grack_auth.rb | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/gitlab/backend/grack_auth.rb b/lib/gitlab/backend/grack_auth.rb index ddf370fbab8..be5c58bb5a6 100644 --- a/lib/gitlab/backend/grack_auth.rb +++ b/lib/gitlab/backend/grack_auth.rb @@ -15,7 +15,7 @@ module Grack @auth = Request.new(env) # Need this patch due to the rails mount - + # Need this if under RELATIVE_URL_ROOT unless Gitlab.config.gitlab.relative_url_root.empty? # If website is mounted using relative_url_root need to remove it first @@ -23,7 +23,7 @@ module Grack else @env['PATH_INFO'] = @request.path end - + @env['SCRIPT_NAME'] = "" auth! @@ -110,7 +110,7 @@ module Grack # Need to reset seek point @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 |