Browse files

port is appended twice to HTTP_HOST when host already has the port

  • Loading branch information...
1 parent c8bf967 commit 268319c8baf4917facdc9bfed89c52bc9bb2a027 @spastorino spastorino committed Sep 26, 2010
Showing with 3 additions and 3 deletions.
  1. +3 −3 actionpack/lib/action_dispatch/testing/integration.rb
View
6 actionpack/lib/action_dispatch/testing/integration.rb
@@ -257,19 +257,19 @@ def process(method, path, parameters = nil, rack_environment = nil)
end
end
- port = host.split(':')[1]
+ hostname, port = host.split(':')
env = {
:method => method,
:params => parameters,
- "SERVER_NAME" => host.split(':')[0],
+ "SERVER_NAME" => hostname,
"SERVER_PORT" => (port ? port : (https? ? "443" : "80")),
"HTTPS" => https? ? "on" : "off",
"rack.url_scheme" => https? ? "https" : "http",
"REQUEST_URI" => path,
- "HTTP_HOST" => [host, port].compact.join(':'),
+ "HTTP_HOST" => host,
"REMOTE_ADDR" => remote_addr,
"CONTENT_TYPE" => "application/x-www-form-urlencoded",
"HTTP_ACCEPT" => accept

0 comments on commit 268319c

Please sign in to comment.