diff options
author | Stan Hu <stanhu@gmail.com> | 2019-01-07 00:35:53 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-01-07 00:35:53 -0800 |
commit | aff2b6e4eb07e8eed09bbc6c4e1a3d46766e1e17 (patch) | |
tree | a850465383209d99365dcc41dcaff5d0354d2fdc /lib/gitlab/middleware | |
parent | b83be5032716548ea9d738a03e0a20f660dc04ac (diff) | |
download | gitlab-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 'lib/gitlab/middleware')
-rw-r--r-- | lib/gitlab/middleware/basic_health_check.rb | 2 | ||||
-rw-r--r-- | lib/gitlab/middleware/read_only/controller.rb | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/gitlab/middleware/basic_health_check.rb b/lib/gitlab/middleware/basic_health_check.rb index f2a03217098..acf8c301b8f 100644 --- a/lib/gitlab/middleware/basic_health_check.rb +++ b/lib/gitlab/middleware/basic_health_check.rb @@ -24,7 +24,7 @@ module Gitlab def call(env) return @app.call(env) unless env['PATH_INFO'] == HEALTH_PATH - request = Rack::Request.new(env) + request = ActionDispatch::Request.new(env) return OK_RESPONSE if client_ip_whitelisted?(request) diff --git a/lib/gitlab/middleware/read_only/controller.rb b/lib/gitlab/middleware/read_only/controller.rb index 89941a9efa0..f142f9da43d 100644 --- a/lib/gitlab/middleware/read_only/controller.rb +++ b/lib/gitlab/middleware/read_only/controller.rb @@ -60,7 +60,7 @@ module Gitlab end def request - @env['rack.request'] ||= Rack::Request.new(@env) + @env['actionpack.request'] ||= ActionDispatch::Request.new(@env) end def last_visited_url |