aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/test
diff options
context:
space:
mode:
authorRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-06 22:42:45 -0300
committerRafael Mendonça França <rafaelmfranca@gmail.com>2015-08-06 22:42:45 -0300
commit3fb5cd4d407840ce0a40e4fc82e07a33768a00be (patch)
tree4cd05510d103f1d3bb604adc8f0c96464bc02b9e /actionpack/test
parentdcc478352219d778b9416f189bcad4a2f7f96cca (diff)
parenta278630f5f1312f6986a866d3bc455c1056e554e (diff)
downloadrails-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/test')
-rw-r--r--actionpack/test/controller/integration_test.rb19
1 files changed, 19 insertions, 0 deletions
diff --git a/actionpack/test/controller/integration_test.rb b/actionpack/test/controller/integration_test.rb
index 0b9be8d671..dc4c32b07e 100644
--- a/actionpack/test/controller/integration_test.rb
+++ b/actionpack/test/controller/integration_test.rb
@@ -755,6 +755,25 @@ class MetalIntegrationTest < ActionDispatch::IntegrationTest
assert_equal "http://test.com/", @request.env["HTTP_REFERER"]
end
+ def test_ignores_common_ports_in_host
+ get "http://test.com"
+ assert_equal "test.com", @request.env["HTTP_HOST"]
+
+ get "https://test.com"
+ assert_equal "test.com", @request.env["HTTP_HOST"]
+ end
+
+ def test_keeps_uncommon_ports_in_host
+ get "http://test.com:123"
+ assert_equal "test.com:123", @request.env["HTTP_HOST"]
+
+ get "http://test.com:443"
+ assert_equal "test.com:443", @request.env["HTTP_HOST"]
+
+ get "https://test.com:80"
+ assert_equal "test.com:80", @request.env["HTTP_HOST"]
+ end
+
end
class ApplicationIntegrationTest < ActionDispatch::IntegrationTest