Commit 08018b7a authored by Patricio Cano's avatar Patricio Cano

Render :forbidden *only* if HTTP is disabled.

parent 58418515
...@@ -19,7 +19,7 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -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
...@@ -180,6 +180,10 @@ class Projects::GitHttpController < Projects::ApplicationController ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment