tls: In HTTP->HTTPS redirects, preserve redir port in some circumstances

Only strip the port from the Location URL value if the port is NOT the
HTTPSPort (before, we compared against DefaultHTTPSPort instead of
HTTPSPort). The HTTPSPort can be changed, but is done so for port
forwarding, since in reality you can't 'change' the standard HTTPS port,
you can only forward it.
This commit is contained in:
Matthew Holt committed 2018-02-16 12:36:28 -07:00
1 parent 8db80c4a88
commit a03eba6fbc
2 files changed
+25 -16

No files matched your search

+1 -1
View File
@@ -53,7 +53,7 @@ func TestRedirPlaintextHost(t *testing.T) {
},
{
Host: "foohost",
Port: "443", // since this is the default HTTPS port, should not be included in Location value
Port: HTTPSPort, // since this is the 'default' HTTPS port, should not be included in Location value
},
{
Host: "*.example.com",