summaryrefslogtreecommitdiff
path: root/spec/requests/git_http_spec.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-01-07 00:35:53 -0800
committerStan Hu <stanhu@gmail.com>2019-01-07 00:35:53 -0800
commitaff2b6e4eb07e8eed09bbc6c4e1a3d46766e1e17 (patch)
treea850465383209d99365dcc41dcaff5d0354d2fdc /spec/requests/git_http_spec.rb
parentb83be5032716548ea9d738a03e0a20f660dc04ac (diff)
downloadgitlab-ce-aff2b6e4eb07e8eed09bbc6c4e1a3d46766e1e17.tar.gz
Switch use of Rack::Request to ActionDispatch::Request
As mentioned in https://gitlab.com/gitlab-org/gitlab-ee/issues/9035#note_129093444, Rails 5 switched ActionDispatch::Request so that it no longer inherits Rack::Request directly. A middleware that uses Rack::Request to read the environment may see stale request parameters if another middleware modifies the environment via ActionDispatch::Request. To be safe, we should be using ActionDispatch::Request everywhere.
Diffstat (limited to 'spec/requests/git_http_spec.rb')
-rw-r--r--spec/requests/git_http_spec.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/spec/requests/git_http_spec.rb b/spec/requests/git_http_spec.rb
index 939e870ec53..5b625fd47be 100644
--- a/spec/requests/git_http_spec.rb
+++ b/spec/requests/git_http_spec.rb
@@ -387,7 +387,7 @@ describe 'Git HTTP requests' do
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')
+ allow_any_instance_of(ActionDispatch::Request).to receive(:ip).and_return('1.2.3.4')
clone_get(path, env)
@@ -548,7 +548,7 @@ describe 'Git HTTP requests' do
maxretry = options[:maxretry] - 1
ip = '1.2.3.4'
- allow_any_instance_of(Rack::Request).to receive(:ip).and_return(ip)
+ allow_any_instance_of(ActionDispatch::Request).to receive(:ip).and_return(ip)
Rack::Attack::Allow2Ban.reset(ip, options)
maxretry.times.each do