summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--app/controllers/projects/git_http_controller.rb6
1 files changed, 5 insertions, 1 deletions
diff --git a/app/controllers/projects/git_http_controller.rb b/app/controllers/projects/git_http_controller.rb
index 072702ec9a2..ef7ccccd9e5 100644
--- a/app/controllers/projects/git_http_controller.rb
+++ b/app/controllers/projects/git_http_controller.rb
@@ -19,7 +19,7 @@ class Projects::GitHttpController < Projects::ApplicationController
render_ok
elsif receive_pack? && receive_pack_allowed?
render_ok
- elsif !upload_pack_allowed?
+ elsif http_blocked?
render_not_allowed
else
render_not_found
@@ -180,6 +180,10 @@ class Projects::GitHttpController < Projects::ApplicationController
@access = Gitlab::GitAccess.new(user, project, 'http').check('git-upload-pack')
end
+ def http_blocked?
+ access.message.include?('HTTP')
+ end
+
def receive_pack_allowed?
return false unless Gitlab.config.gitlab_shell.receive_pack