diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-24 06:01:44 +0300 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-06 00:54:22 +0300 |
commit | 08018b7a7a6e885952f0ade3b62e2059239bddc7 (patch) | |
tree | 3efbb582325ed13b0ae21de7d72516bab5fe2e83 /app/controllers/projects/git_http_controller.rb | |
parent | 5841851551db6b9aa682b17a075535cd431c2c2a (diff) |
Render :forbidden *only* if HTTP is disabled.
Diffstat (limited to 'app/controllers/projects/git_http_controller.rb')
-rw-r--r-- | app/controllers/projects/git_http_controller.rb | 6 |
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 |