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:
authorTiago Botelho <tiagonbotelho@hotmail.com>2018-01-24 15:25:10 +0300
committerTiago Botelho <tiagonbotelho@hotmail.com>2018-07-25 11:43:44 +0300
commit0fd901bdddd097f710eb3d2ab554d6b5fc6c7ab0 (patch)
treec7c0c86747759776c63ed1dea84f849bdedeeb1a /spec/requests
parent4063141223f9b89248e3c33df5711201f75d3718 (diff)
Disables Rack Attack by default
Diffstat (limited to 'spec/requests')
-rw-r--r--spec/requests/git_http_spec.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb
index 0f3e7157e14..c71eae9164a 100644
--- a/spec/requests/git_http_spec.rb
+++ b/spec/requests/git_http_spec.rb
@@ -381,6 +381,10 @@ describe 'Git HTTP requests' do
context "when authentication fails" do
context "when the user is IP banned" do
+ before do
+ Gitlab.config.rack_attack.git_basic_auth['enabled'] = true
+ end
+
it "responds with status 401" do
expect(Rack::Attack::Allow2Ban).to receive(:filter).and_return(true)
allow_any_instance_of(Rack::Request).to receive(:ip).and_return('1.2.3.4')
@@ -420,6 +424,10 @@ describe 'Git HTTP requests' do
end
context "when the user isn't blocked" do
+ before do
+ Gitlab.config.rack_attack.git_basic_auth['enabled'] = true
+ end
+
it "resets the IP in Rack Attack on download" do
expect(Rack::Attack::Allow2Ban).to receive(:reset).twice