Skip to content
Snippets Groups Projects
Commit 08018b7a authored by Patricio Cano's avatar Patricio Cano
Browse files

Render :forbidden *only* if HTTP is disabled.

parent 58418515
No related branches found
No related tags found
No related merge requests found
Loading
@@ -19,7 +19,7 @@ class Projects::GitHttpController < Projects::ApplicationController
Loading
@@ -19,7 +19,7 @@ class Projects::GitHttpController < Projects::ApplicationController
render_ok render_ok
elsif receive_pack? && receive_pack_allowed? elsif receive_pack? && receive_pack_allowed?
render_ok render_ok
elsif !upload_pack_allowed? elsif http_blocked?
render_not_allowed render_not_allowed
else else
render_not_found render_not_found
Loading
@@ -180,6 +180,10 @@ class Projects::GitHttpController < Projects::ApplicationController
Loading
@@ -180,6 +180,10 @@ class Projects::GitHttpController < Projects::ApplicationController
@access = Gitlab::GitAccess.new(user, project, 'http').check('git-upload-pack') @access = Gitlab::GitAccess.new(user, project, 'http').check('git-upload-pack')
end end
   
def http_blocked?
access.message.include?('HTTP')
end
def receive_pack_allowed? def receive_pack_allowed?
return false unless Gitlab.config.gitlab_shell.receive_pack return false unless Gitlab.config.gitlab_shell.receive_pack
   
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