ID:               47687
 User updated by:  make dot fire at gmail dot com
 Reported By:      make dot fire at gmail dot com
 Status:           Open
 Bug Type:         HTTP related
 Operating System: windows server 2008
 PHP Version:      5.3CVS-2009-03-17 (snap)
 New Comment:

And, the workaround in #25044 is not working,
the code:

header("Location: http://www.php.net/";);
header('HTTP/1.1 303 See Other');

or

header("Location: http://www.php.net/";);
header('HTTP/1.1 303 See Other', true, 303);

will result same response header:

HTTP/1.0 302 Found
Location: http://www.php.net/


Previous Comments:
------------------------------------------------------------------------

[2009-03-17 09:54:21] make dot fire at gmail dot com

Description:
------------
This bug is identical to bug #25044.

When setting the "Location" HTTP header using the header() function,
PHP automatically changes the HTTP response status to "302 Found",
Whether other status codes is already set or not.



Reproduce code:
---------------
file1.php:
<?php
header('HTTP/1.1 201 Created');
header("Location: http://www.php.net/";);
exit;
?>

file2.php:
<?php
header('HTTP/1.1 303 See Other');
header("Location: http://www.php.net/";);
exit;
?>

Expected result:
----------------
HTTP Response:

file1.php:

HTTP/1.1 201 Created
Location: http://www.php.net/


file2.php:

HTTP/1.1 303 See Other
Location: http://www.php.net/


Actual result:
--------------
HTTP Response:

file1.php:

HTTP/1.0 302 Found
Location: http://www.php.net/


file2.php:

HTTP/1.0 302 Found
Location: http://www.php.net/



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=47687&edit=1

Reply via email to