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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
957edb13
Commit
957edb13
authored
May 17, 2017
by
Michael Kozono
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Refactor to let `GitAccess` check protocol config
This already works due to previous refactoring.
parent
9d78f835
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
0 additions
and
10 deletions
+0
-10
app/controllers/projects/git_http_controller.rb
app/controllers/projects/git_http_controller.rb
+0
-10
No files found.
app/controllers/projects/git_http_controller.rb
View file @
957edb13
...
...
@@ -10,8 +10,6 @@ class Projects::GitHttpController < Projects::GitHttpClientController
render_ok
elsif
receive_pack?
&&
receive_pack_allowed?
render_ok
elsif
http_blocked?
render_http_not_allowed
else
render_denied
end
...
...
@@ -62,10 +60,6 @@ class Projects::GitHttpController < Projects::GitHttpClientController
render
json:
Gitlab
::
Workhorse
.
git_http_ok
(
repository
,
wiki?
,
user
,
action_name
)
end
def
render_http_not_allowed
render
plain:
access_check
.
message
,
status: :forbidden
end
def
render_denied
if
access_check
.
message
==
Gitlab
::
GitAccess
::
ERROR_MESSAGES
[
:project_not_found
]
render
plain:
access_check
.
message
,
status: :not_found
...
...
@@ -93,10 +87,6 @@ class Projects::GitHttpController < Projects::GitHttpClientController
@access_check
||=
access
.
check
(
git_command
,
'_any'
)
end
def
http_blocked?
!
access
.
protocol_allowed?
end
def
receive_pack_allowed?
access_check
.
allowed?
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