summaryrefslogtreecommitdiff
path: root/spec/lib/constraints
diff options
context:
space:
mode:
authorMark Chao <mchao@gitlab.com>2019-02-18 11:51:56 +0800
committerMark Chao <mchao@gitlab.com>2019-02-19 14:42:38 +0800
commitd8f0d347b45aa57ac726d59fbd164df5c3a8e60a (patch)
tree88fa2da42e98aff32a3075c67b496c701f7b8891 /spec/lib/constraints
parentc46c62c51316da73724848b5f0dcb5aba82475e2 (diff)
downloadgitlab-ce-d8f0d347b45aa57ac726d59fbd164df5c3a8e60a.tar.gz
Fix git clone revealing private repo's presence
Ensure redirection to path with .git suffix regardless whether project exists or not.
Diffstat (limited to 'spec/lib/constraints')
-rw-r--r--spec/lib/constraints/project_url_constrainer_spec.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/spec/lib/constraints/project_url_constrainer_spec.rb b/spec/lib/constraints/project_url_constrainer_spec.rb
index c96e7ab8495..3496b01ebcc 100644
--- a/spec/lib/constraints/project_url_constrainer_spec.rb
+++ b/spec/lib/constraints/project_url_constrainer_spec.rb
@@ -16,6 +16,10 @@ describe Constraints::ProjectUrlConstrainer do
let(:request) { build_request('foo', 'bar') }
it { expect(subject.matches?(request)).to be_falsey }
+
+ context 'existence_check is false' do
+ it { expect(subject.matches?(request, existence_check: false)).to be_truthy }
+ end
end
context "project id ending with .git" do