Redirects incorrectly set Location header in response when Host header is set in request
When Apache sends a 301 redirect and the Host header in the request has an implicit port, it incorrectly uses the Host header of the request and the port that Apache is running on to set the Location header.
Steps to reproduce:
* Get Apache to serve up a directory with a sub-directory "blah" on a particular port, say, 8080.
* Access the URL "http://
* Note that the Location header in the response is "Location: http://
* A location header that uses the Host header only, rather than combining the Host header and the port Apache is running on.
If the Host header has a port explicitly set, Apache behaves correctly e.g. if the Host header is "Host: example.com:8090", then the Location header in the response is "Location: http://
$ apt-cache policy apache2
*** 2.2.22-1ubuntu1 0
$ lsb_release -rd
Description: Ubuntu 12.04 LTS
|Changed in apache2 (Ubuntu):|
|status:||Incomplete → New|