Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-08-15 19:53:10 +0300
committerDouglas Barbosa Alexandre <dbalexandre@gmail.com>2019-08-15 19:53:10 +0300
commit903281454277805813eefd200d4279c6c4426a70 (patch)
treef7502242dd4baf4b258a509bec44e13e786c04c7 /spec/controllers
parent8c8824d44290b920c57ba02c7aaa1a0aa3a8268f (diff)
parent7f00bcb92ef72f520b4ffcb443791be0be5a685b (diff)
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 'spec/controllers')
-rw-r--r--spec/controllers/projects/git_http_controller_spec.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/spec/controllers/projects/git_http_controller_spec.rb b/spec/controllers/projects/git_http_controller_spec.rb
index bf099e8deeb..88fa2236e33 100644
--- a/spec/controllers/projects/git_http_controller_spec.rb
+++ b/spec/controllers/projects/git_http_controller_spec.rb
@@ -12,4 +12,15 @@ describe Projects::GitHttpController do
expect(response.status).to eq(403)
end
end
+
+ describe 'GET #info_refs' do
+ it 'returns 401 for unauthenticated requests to public repositories when http protocol is disabled' do
+ stub_application_setting(enabled_git_access_protocol: 'ssh')
+ project = create(:project, :public, :repository)
+
+ get :info_refs, params: { service: 'git-upload-pack', namespace_id: project.namespace.to_param, project_id: project.path + '.git' }
+
+ expect(response.status).to eq(401)
+ end
+ end
end