Closed nicorikken closed 7 years ago
This seems reasonable to me. I'm happy to merge if you can verify this works on FF, Chrome and Safari.
I have verified that this fix is working, with:
51.0.1 (64-bit)
Version 58.0.2999.0 (64-bit)
Version 10.0 (11602.1.50.0.10)
Great!
The existing implementation only checks based on the hostname. If a uri links to a different portnumber on the same host, this was not considered a redirect. In situations like local development were multiple services might be running on the same host, this results in links not working.
This commit includes the portnumber into the validation. In case no explicit port is mentioned, both
port
andcurrent-port
will return nil. If an explicit port is used, the comparison will be based on port numbers.I have not verified the browser support of this feature, so I do not know if this breaks any existing setups on non-mainstream browsers.