Skip to content
Snippets Groups Projects
Commit ef61d1f2 authored by tsl0922's avatar tsl0922
Browse files

fix http push 401

parent ae006dd9
No related branches found
No related tags found
1 merge request!3634fix http push 401 and 500 with some git clients
Loading
Loading
@@ -76,13 +76,17 @@ module Grack
end
 
def validate_get_request
project.public || can?(user, :download_code, project)
validate_request(@request.params['service'])
end
 
def validate_post_request
if @request.path_info.end_with?('git-upload-pack')
validate_request(File.basename(@request.path))
end
def validate_request(service)
if service == 'git-upload-pack'
project.public || can?(user, :download_code, project)
elsif @request.path_info.end_with?('git-receive-pack')
elsif service == 'git-receive-pack'
action = if project.protected_branch?(current_ref)
:push_code_to_protected_branches
else
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment