Permalink
Browse files

make sure the https redirect defaults to 443

If the redirect source url contains a port e.g. (http://example.com:8080) the current implementation generates a redirect to https://example.com:8080 which seems pretty wrong to me in the general use case
  • Loading branch information...
1 parent 6a6c15d commit 626524deaa758c3d24428eef451200d3351d51e9 @databus23 committed Sep 25, 2012
Showing with 1 addition and 0 deletions.
  1. +1 −0 lib/rack/ssl.rb
View
@@ -49,6 +49,7 @@ def scheme(env)
def redirect_to_https(env)
req = Request.new(env)
url = URI(req.url)
+ url.port = nil # clear out the source port, so it doesn't get used as the default
url.scheme = "https"
url.host = @host if @host
url.port = @port if @port

0 comments on commit 626524d

Please sign in to comment.