php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #49932 Content-Location header is not overwritten
Submitted: 2009-10-20 11:43 UTC Modified: 2009-10-30 01:00 UTC
From: sjoerd-php at linuxonly dot nl Assigned:
Status: No Feedback Package: Apache2 related
PHP Version: 5.2.11 OS: Linux
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please — but make sure to vote on the bug!
Your email address:
MUST BE VALID
Solve the problem:
11 - 2 = ?
Subscribe to this entry?

 
 [2009-10-20 11:43 UTC] sjoerd-php at linuxonly dot nl
Description:
------------
If you access a script by a name other than its filename, it generates a Content-Location HTTP header. For example, if you request '/a' instead of '/a.php', the Content-Location header contains 'a.php'.

If you try to override the Content-Location header in the script, like in the code example below, the response contains two Content-Location headers.

Reproduce code:
---------------
<?php
header('Content-Location: http://www.example.org/a.php');
?>

Expected result:
----------------
One Content-Location header in result:
Content-Location: http://www.example.org/a.php

Actual result:
--------------
Two Content-Location headers in result:
Content-Location: a.php
Content-Location: http://www.example.org/a.php

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-10-22 13:44 UTC] jani@php.net
IIRC, you can only override headers set by PHP itself. I'd guess that header is set by Apache..? You propably should turn off Multiviews..or whatever that was again. What I'm guessing here is that the header is injected after PHP code is run. 
 [2009-10-30 01:00 UTC] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Mon May 20 13:01:34 2024 UTC