diff options
author | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-23 16:48:37 -0700 |
---|---|---|
committer | Aaron Patterson <aaron.patterson@gmail.com> | 2015-08-23 16:48:37 -0700 |
commit | 7de86d2cf31eb0f604700d1550bd875188c6d29b (patch) | |
tree | a74c33772abc51b264fa0250bf7b69fb58eda59b /actionpack/lib | |
parent | a682b44e70ee0cbf21b486450ebaa624ef4446c4 (diff) | |
download | rails-7de86d2cf31eb0f604700d1550bd875188c6d29b.tar.gz rails-7de86d2cf31eb0f604700d1550bd875188c6d29b.tar.bz2 rails-7de86d2cf31eb0f604700d1550bd875188c6d29b.zip |
remove more env access
Diffstat (limited to 'actionpack/lib')
-rw-r--r-- | actionpack/lib/action_controller/test_case.rb | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/test_case.rb b/actionpack/lib/action_controller/test_case.rb index cf306e9a9c..bb73f359c9 100644 --- a/actionpack/lib/action_controller/test_case.rb +++ b/actionpack/lib/action_controller/test_case.rb @@ -472,7 +472,7 @@ module ActionController end self.cookies.update @request.cookies - @request.env['HTTP_COOKIE'] = cookies.to_header + @request.set_header 'HTTP_COOKIE', cookies.to_header @request.delete_header 'action_dispatch.cookies' @request = TestRequest.new scrub_env!(@request.env), @request.session @@ -480,7 +480,7 @@ module ActionController @response.request = @request @controller.recycle! - @request.env['REQUEST_METHOD'] = http_method + @request.set_header 'REQUEST_METHOD', http_method parameters = parameters.symbolize_keys @@ -494,8 +494,10 @@ module ActionController @request.flash.update(flash || {}) if xhr - @request.env['HTTP_X_REQUESTED_WITH'] = 'XMLHttpRequest' - @request.env['HTTP_ACCEPT'] ||= [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ') + @request.set_header 'HTTP_X_REQUESTED_WITH', 'XMLHttpRequest' + @request.get_header('HTTP_ACCEPT') do |k| + @request.set_header k, [Mime::JS, Mime::HTML, Mime::XML, 'text/xml', Mime::ALL].join(', ') + end end @controller.request = @request |