summaryrefslogtreecommitdiff
path: root/spec/requests
diff options
context:
space:
mode:
authorJacob Vosmaer <jacob@gitlab.com>2016-08-03 14:54:12 +0200
committerJacob Vosmaer <jacob@gitlab.com>2016-08-03 14:54:12 +0200
commitb8f754dd0abdf437669e17a820a8e6c230afa73e (patch)
treef76dd495f2e4299c2588a4fb98286b91938d78df /spec/requests
parent132a81f4e1bb1675baa091df3ce1bae415290d7f (diff)
downloadgitlab-ce-b8f754dd0abdf437669e17a820a8e6c230afa73e.tar.gz
Stop 'git push' over HTTP early
Before this change we always let users push Git data over HTTP before deciding whether to accept to push. This was different from pushing over SSH where we terminate a 'git push' early if we already know the user is not allowed to push. This change let Git over HTTP follow the same behavior as Git over SSH. We also distinguish between HTTP 404 and 403 responses when denying Git requests, depending on whether the user is allowed to know the project exists.
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/git_http_spec.rb10
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb
index 82ab582beac..febfdf48c7e 100644
--- a/spec/requests/git_http_spec.rb
+++ b/spec/requests/git_http_spec.rb
@@ -75,9 +75,9 @@ describe 'Git HTTP requests', lib: true do
context "with correct credentials" do
let(:env) { { user: user.username, password: user.password } }
- it "uploads get status 200 (because Git hooks do the real check)" do
+ it "uploads get status 403" do
upload(path, env) do |response|
- expect(response).to have_http_status(200)
+ expect(response).to have_http_status(403)
end
end
@@ -86,7 +86,7 @@ describe 'Git HTTP requests', lib: true do
allow(Gitlab.config.gitlab_shell).to receive(:receive_pack).and_return(false)
upload(path, env) do |response|
- expect(response).to have_http_status(404)
+ expect(response).to have_http_status(403)
end
end
end
@@ -236,9 +236,9 @@ describe 'Git HTTP requests', lib: true do
end
end
- it "uploads get status 200 (because Git hooks do the real check)" do
+ it "uploads get status 404" do
upload(path, user: user.username, password: user.password) do |response|
- expect(response).to have_http_status(200)
+ expect(response).to have_http_status(404)
end
end
end