diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-08-06 22:42:45 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-08-06 22:42:45 -0300 |
commit | 3fb5cd4d407840ce0a40e4fc82e07a33768a00be (patch) | |
tree | 4cd05510d103f1d3bb604adc8f0c96464bc02b9e /actionpack/lib/action_dispatch/testing | |
parent | dcc478352219d778b9416f189bcad4a2f7f96cca (diff) | |
parent | a278630f5f1312f6986a866d3bc455c1056e554e (diff) | |
download | rails-3fb5cd4d407840ce0a40e4fc82e07a33768a00be.tar.gz rails-3fb5cd4d407840ce0a40e4fc82e07a33768a00be.tar.bz2 rails-3fb5cd4d407840ce0a40e4fc82e07a33768a00be.zip |
Merge pull request #21153 from grosser/grosser/ports
do not add common ports to HTTP_HOST
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
-rw-r--r-- | actionpack/lib/action_dispatch/testing/integration.rb | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/actionpack/lib/action_dispatch/testing/integration.rb b/actionpack/lib/action_dispatch/testing/integration.rb index 0298962409..06605f5b33 100644 --- a/actionpack/lib/action_dispatch/testing/integration.rb +++ b/actionpack/lib/action_dispatch/testing/integration.rb @@ -325,7 +325,11 @@ module ActionDispatch if path =~ %r{://} location = URI.parse(path) https! URI::HTTPS === location if location.scheme - host! "#{location.host}:#{location.port}" if location.host + if url_host = location.host + default = Rack::Request::DEFAULT_PORTS[location.scheme] + url_host += ":#{location.port}" if default != location.port + host! url_host + end path = location.query ? "#{location.path}?#{location.query}" : location.path end |