diff --git a/app/controllers/projects/git_http_controller.rb b/app/controllers/projects/git_http_controller.rb index 072702ec9a2706bf033647d557bed1501cee2335..ef7ccccd9e5c4c0b7db8d9291564ea0bb4c15927 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