|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-09-21 09:08 UTC] svn@php.net
[2009-09-21 09:09 UTC] torben@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 09:00:02 2026 UTC |
Description: ------------ The manual for header() states that: "The second special case is the "Location:" header. Not only does it send this header back to the browser, but it also returns a REDIRECT (302) status code to the browser unless some 3xx status code has already been set. " PHP not only preserves 3xx status codes, but also appears to preserve the 201 status code (which is desirable because the 201 code can also accompany the Location header field). Reproduce code: --------------- header('HTTP/1.1 201 Created', true, 201); header('Location: http://www.php.net'); Expected result: ---------------- HTTP/1.1 302 Found (if you go by the manual) Actual result: -------------- HTTP/1.1 201 Created