diff options
author | Patricio Cano <suprnova32@gmail.com> | 2016-06-23 22:01:44 -0500 |
---|---|---|
committer | Patricio Cano <suprnova32@gmail.com> | 2016-07-05 16:54:22 -0500 |
commit | 08018b7a7a6e885952f0ade3b62e2059239bddc7 (patch) | |
tree | 3efbb582325ed13b0ae21de7d72516bab5fe2e83 | |
parent | 5841851551db6b9aa682b17a075535cd431c2c2a (diff) | |
download | gitlab-ce-08018b7a7a6e885952f0ade3b62e2059239bddc7.tar.gz |
Render :forbidden *only* if HTTP is disabled.
-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 |