1
0
Fork 0
mirror of https://github.com/rails/rails.git synced 2022-11-09 12:12:34 -05:00

Encode ActionDispatch::TestRequest::DEFAULT_ENV headers as ASCII-8BIT

Request headers provided by servers are ASCII-8BIT encoded. This commit sets up the `ActionDispatch::TestRequest::DEFAULT_ENV` headers so that they are likewise encoded as ASCII-8BIT.
This commit is contained in:
Cliff Pruitt 2019-08-22 12:58:57 -04:00
parent 4dbb7aa58b
commit da0bcfb44a

View file

@ -6,9 +6,9 @@ require "rack/utils"
module ActionDispatch
class TestRequest < Request
DEFAULT_ENV = Rack::MockRequest.env_for("/",
"HTTP_HOST" => "test.host",
"REMOTE_ADDR" => "0.0.0.0",
"HTTP_USER_AGENT" => "Rails Testing",
"HTTP_HOST" => "test.host".b,
"REMOTE_ADDR" => "0.0.0.0".b,
"HTTP_USER_AGENT" => "Rails Testing".b,
)
# Create a new test request with default +env+ values.