aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/testing/integration.rb
diff options
context:
space:
mode:
authorSantiago Pastorino <santiago@wyeworks.com>2010-09-26 12:06:19 -0300
committerSantiago Pastorino <santiago@wyeworks.com>2010-09-26 12:06:19 -0300
commit29f13beda35e30b472c6617fcf3fc5cc22d3468a (patch)
tree8f51eac609fc19fac3c7e2adbe01153fef4d6e76 /actionpack/lib/action_dispatch/testing/integration.rb
parent14d2feeeab44d0161b3014c9e19f4e336c09c78e (diff)
downloadrails-29f13beda35e30b472c6617fcf3fc5cc22d3468a.tar.gz
rails-29f13beda35e30b472c6617fcf3fc5cc22d3468a.tar.bz2
rails-29f13beda35e30b472c6617fcf3fc5cc22d3468a.zip
port is appended twice to HTTP_HOST when host already has the port
Diffstat (limited to 'actionpack/lib/action_dispatch/testing/integration.rb')
-rw-r--r--actionpack/lib/action_dispatch/testing/integration.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb
index 84039c06ab..404b6185c2 100644
--- a/actionpack/lib/action_dispatch/testing/integration.rb
+++ b/actionpack/lib/action_dispatch/testing/integration.rb
@@ -257,19 +257,19 @@ module ActionDispatch
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