Bug->Doc #65791 [Opn]: Mixing header('Status', and other header with int $http_response_code
| From: | mike@php.net | Date: | Wed, 02 Oct 2013 09:25:16 +0000 |
| Subject: | Bug->Doc #65791 [Opn]: Mixing header('Status', and other header with int $http_response_code | ||
| References: | 1 | Groups: | php.doc.bugs |
| Request: | Send a blank email to doc-bugs+get-10353@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=65791&edit=1
ID: 65791
Updated by: mike@php.net
Reported by: rainer-phpbugs at 7val dot com
Summary: Mixing header('Status', and other header with int
$http_response_code
Status: Open
-Type: Bug
+Type: Documentation Problem
Package: HTTP related
PHP Version: 5.4.20
Block user comment: N
Private report: N
New Comment:
"Status:" is just a special CGI header and not handled by PHP at all.
Previous Comments:
------------------------------------------------------------------------
[2013-09-30 17:20:35] rainer-phpbugs at 7val dot com
Description:
------------
The int $http_response_code for later calls to header() don't update any earlier codes set with
header('Status: ???'). The Documentation claims that it "Forces the HTTP response
code to the specified value". If header('Status: ...') has not been used beforehand,
setting http_response_code works as expected.
Test script:
---------------
<?php
header('Status: 500 Internat Server Error', true, 500);
header('Status: 200 OK', true, 200);
header('WWW-Authenticate: Basic realm="Access"', true, 401);
/* this would work: header('Status: 401 OK', true, 401); */
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=65791&edit=1