Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jérome Perrin
gitlab-ce
Commits
ef61d1f2
Commit
ef61d1f2
authored
Apr 19, 2013
by
tsl0922
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix http push 401
parent
ae006dd9
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
3 deletions
+7
-3
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+7
-3
No files found.
lib/gitlab/backend/grack_auth.rb
View file @
ef61d1f2
...
@@ -76,13 +76,17 @@ module Grack
...
@@ -76,13 +76,17 @@ module Grack
end
end
def
validate_get_request
def
validate_get_request
project
.
public
||
can?
(
user
,
:download_code
,
project
)
validate_request
(
@request
.
params
[
'service'
]
)
end
end
def
validate_post_request
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
)
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
)
action
=
if
project
.
protected_branch?
(
current_ref
)
:push_code_to_protected_branches
:push_code_to_protected_branches
else
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment