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
ae9e5eea
Commit
ae9e5eea
authored
Jul 28, 2015
by
GitLab
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Handle missing @user during Git HTTP requests
parent
d3305df7
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
1 deletion
+10
-1
lib/gitlab/backend/grack_auth.rb
lib/gitlab/backend/grack_auth.rb
+10
-1
No files found.
lib/gitlab/backend/grack_auth.rb
View file @
ae9e5eea
...
@@ -28,7 +28,7 @@ module Grack
...
@@ -28,7 +28,7 @@ module Grack
if
project
&&
authorized_request?
if
project
&&
authorized_request?
if
ENV
[
'GITLAB_GRACK_AUTH_ONLY'
]
==
'1'
if
ENV
[
'GITLAB_GRACK_AUTH_ONLY'
]
==
'1'
# Tell gitlab-git-http-server the request is OK, and what the GL_ID is
# Tell gitlab-git-http-server the request is OK, and what the GL_ID is
[
200
,
{
"Content-Type"
=>
"text/plain"
},
[
Gitlab
::
ShellEnv
.
gl_id
(
@user
)]]
render_grack_auth_ok
else
else
@app
.
call
(
env
)
@app
.
call
(
env
)
end
end
...
@@ -179,6 +179,15 @@ module Grack
...
@@ -179,6 +179,15 @@ module Grack
end
end
end
end
def
render_grack_auth_ok
if
@user
.
present?
body
=
Gitlab
::
ShellEnv
.
gl_id
(
@user
)
else
body
=
''
end
[
200
,
{
"Content-Type"
=>
"text/plain"
},
[
body
]]
end
def
render_not_found
def
render_not_found
[
404
,
{
"Content-Type"
=>
"text/plain"
},
[
"Not Found"
]]
[
404
,
{
"Content-Type"
=>
"text/plain"
},
[
"Not Found"
]]
end
end
...
...
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