summaryrefslogtreecommitdiff
path: root/app/controllers
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-08-15 16:53:10 +0000
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-08-15 16:53:10 +0000
commit903281454277805813eefd200d4279c6c4426a70 (patch)
treef7502242dd4baf4b258a509bec44e13e786c04c7 /app/controllers
parent8c8824d44290b920c57ba02c7aaa1a0aa3a8268f (diff)
parent7f00bcb92ef72f520b4ffcb443791be0be5a685b (diff)
downloadgitlab-ce-903281454277805813eefd200d4279c6c4426a70.tar.gz
Merge branch 'dblessing-fix-public-project-ssh-only-ci-failure' into 'master'
Allow CI to clone public projects when HTTP protocol is disabled Closes #65805 See merge request gitlab-org/gitlab-ce!31632
Diffstat (limited to 'app/controllers')
-rw-r--r--app/controllers/projects/git_http_client_controller.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/app/controllers/projects/git_http_client_controller.rb b/app/controllers/projects/git_http_client_controller.rb
index 956093b972b..abf8407a51c 100644
--- a/app/controllers/projects/git_http_client_controller.rb
+++ b/app/controllers/projects/git_http_client_controller.rb
@@ -49,7 +49,8 @@ class Projects::GitHttpClientController < Projects::ApplicationController
send_final_spnego_response
return # Allow access
end
- elsif project && download_request? && Guest.can?(:download_code, project)
+ elsif project && download_request? && http_allowed? && Guest.can?(:download_code, project)
+
@authentication_result = Gitlab::Auth::Result.new(nil, project, :none, [:download_code])
return # Allow access
@@ -113,4 +114,8 @@ class Projects::GitHttpClientController < Projects::ApplicationController
def ci?
authentication_result.ci?(project)
end
+
+ def http_allowed?
+ Gitlab::ProtocolAccess.allowed?('http')
+ end
end