Fixes an issue with Location header redirects when requests are going through a non-traditional port.