From:             make dot fire at gmail dot com
Operating system: windows server 2008
PHP version:      5.3CVS-2009-03-17 (snap)
PHP Bug Type:     HTTP related
Bug description:  header("Location:") changing HTTP status

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 bug report at http://bugs.php.net/?id=47687&edit=1
-- 
Try a CVS snapshot (PHP 5.2):        
http://bugs.php.net/fix.php?id=47687&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):        
http://bugs.php.net/fix.php?id=47687&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):        
http://bugs.php.net/fix.php?id=47687&r=trysnapshot60
Fixed in CVS:                        
http://bugs.php.net/fix.php?id=47687&r=fixedcvs
Fixed in CVS and need be documented: 
http://bugs.php.net/fix.php?id=47687&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=47687&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=47687&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=47687&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=47687&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=47687&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=47687&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=47687&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=47687&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=47687&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=47687&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=47687&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=47687&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=47687&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=47687&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=47687&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=47687&r=mysqlcfg

Reply via email to