Public bug reported:

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://localhost:8080/blah"; (note no trailing slash) with 
the Host header "Host: example.com".
  * Note that the Location header in the response is "Location: 
http://example.com:8080/blah/"; rather than "Location http://example.com/blah/"; 
as it should be.

Expected behaviour:
  * 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://example.com:8090/blah/";.

$ apt-cache policy apache2
apache2:
  Installed: 2.2.22-1ubuntu1
  Candidate: 2.2.22-1ubuntu1
  Version table:
 *** 2.2.22-1ubuntu1 0
        500 http://gb.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status


$ lsb_release -rd
Description:    Ubuntu 12.04 LTS
Release:        12.04

** Affects: apache2 (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1018285

Title:
  Redirects incorrectly set Location header in response when Host header
  is set in request

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/apache2/+bug/1018285/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to