aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch
diff options
context:
space:
mode:
authorAndrew White <andyw@pixeltrix.co.uk>2014-05-11 12:56:33 +0100
committerAndrew White <andyw@pixeltrix.co.uk>2014-05-11 12:59:37 +0100
commit2378f69e69f98460f426d2c4e0fbb967b4fa5ddf (patch)
tree698f04a891468a68a1aeaaeb1aafa6760e9a8e06 /actionpack/lib/action_dispatch
parentbe93d94ef28421a2dbcd6ed870b454433a5a0a72 (diff)
downloadrails-2378f69e69f98460f426d2c4e0fbb967b4fa5ddf.tar.gz
rails-2378f69e69f98460f426d2c4e0fbb967b4fa5ddf.tar.bz2
rails-2378f69e69f98460f426d2c4e0fbb967b4fa5ddf.zip
Always use the provided port for protocol relative urls
There may be situations where you need to tunnel SSL connections over port 80 so we shouldn't remove it if it has been explicitly provided.
Diffstat (limited to 'actionpack/lib/action_dispatch')
-rw-r--r--actionpack/lib/action_dispatch/http/url.rb2
1 files changed, 2 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/http/url.rb b/actionpack/lib/action_dispatch/http/url.rb
index 77ea0cf658..c9860af909 100644
--- a/actionpack/lib/action_dispatch/http/url.rb
+++ b/actionpack/lib/action_dispatch/http/url.rb
@@ -135,6 +135,8 @@ module ActionDispatch
return nil if options[:port].nil? || options[:port] == false
case options[:protocol]
+ when "//"
+ options[:port]
when "https://"
options[:port].to_i == 443 ? nil : options[:port]
else