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
Tatuya Kamada
gitlab-ce
Commits
aaa916f1
Commit
aaa916f1
authored
Sep 17, 2012
by
Saito
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use high level api and compatibility with Passenger
parent
b5442eb5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
7 deletions
+8
-7
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+8
-7
No files found.
lib/gitlab/backend/grack_auth.rb
View file @
aaa916f1
...
@@ -12,21 +12,22 @@ module Grack
...
@@ -12,21 +12,22 @@ module Grack
# Pass Gitolite update hook
# Pass Gitolite update hook
ENV
[
'GL_BYPASS_UPDATE_HOOK'
]
=
"true"
ENV
[
'GL_BYPASS_UPDATE_HOOK'
]
=
"true"
# Need this patch because the rails mount
# Need this patch due to the rails mount
@env
[
'PATH_INFO'
]
=
@env
[
'REQUEST_PATH'
]
@env
[
'PATH_INFO'
]
=
@request
.
path
@env
[
'SCRIPT_NAME'
]
=
""
# Find project by PATH_INFO from env
# Find project by PATH_INFO from env
if
m
=
/^\/([\w-]+).git/
.
match
(
@
env
[
'PATH_INFO'
]
).
to_a
if
m
=
/^\/([\w-]+).git/
.
match
(
@
request
.
path_info
).
to_a
return
false
unless
project
=
Project
.
find_by_path
(
m
.
last
)
return
false
unless
project
=
Project
.
find_by_path
(
m
.
last
)
end
end
# Git upload and receive
# Git upload and receive
if
@
env
[
'REQUEST_METHOD'
]
==
'GET'
if
@
request
.
get?
true
true
elsif
@
env
[
'REQUEST_METHOD'
]
==
'POST'
elsif
@
request
.
post?
if
@
env
[
'REQUEST_URI'
]
.
end_with?
(
'git-upload-pack'
)
if
@
request
.
path_info
.
end_with?
(
'git-upload-pack'
)
return
project
.
dev_access_for?
(
user
)
return
project
.
dev_access_for?
(
user
)
elsif
@
env
[
'REQUEST_URI'
]
.
end_with?
(
'git-receive-pack'
)
elsif
@
request
.
path_info
.
end_with?
(
'git-receive-pack'
)
if
project
.
protected_branches
.
map
(
&
:name
).
include?
(
current_ref
)
if
project
.
protected_branches
.
map
(
&
:name
).
include?
(
current_ref
)
project
.
master_access_for?
(
user
)
project
.
master_access_for?
(
user
)
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