Skip to content

Commit

Permalink
port is appended twice to HTTP_HOST when host already has the port
Browse files Browse the repository at this point in the history
  • Loading branch information
spastorino committed Sep 26, 2010
1 parent 14d2fee commit 29f13be
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions actionpack/lib/action_dispatch/testing/integration.rb
Expand Up @@ -257,19 +257,19 @@ def process(method, path, parameters = nil, rack_environment = nil)
end end
end end


port = host.split(':')[1] hostname, port = host.split(':')


env = { env = {
:method => method, :method => method,
:params => parameters, :params => parameters,


"SERVER_NAME" => host.split(':')[0], "SERVER_NAME" => hostname,
"SERVER_PORT" => (port ? port : (https? ? "443" : "80")), "SERVER_PORT" => (port ? port : (https? ? "443" : "80")),
"HTTPS" => https? ? "on" : "off", "HTTPS" => https? ? "on" : "off",
"rack.url_scheme" => https? ? "https" : "http", "rack.url_scheme" => https? ? "https" : "http",


"REQUEST_URI" => path, "REQUEST_URI" => path,
"HTTP_HOST" => [host, port].compact.join(':'), "HTTP_HOST" => host,
"REMOTE_ADDR" => remote_addr, "REMOTE_ADDR" => remote_addr,
"CONTENT_TYPE" => "application/x-www-form-urlencoded", "CONTENT_TYPE" => "application/x-www-form-urlencoded",
"HTTP_ACCEPT" => accept "HTTP_ACCEPT" => accept
Expand Down

0 comments on commit 29f13be

Please sign in to comment.