|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2018-11-14 19:26 UTC] marnick dot leau at gmail dot com
Description:
------------
In the selected version and some previous ones going back a few weeks or months (not sure which exact versions), a change was apparently made to the Location header mechanism.
Test script:
---------------
http_response_code(201);
header('HTTP/1.1 201 Created', true, 201);
header('Location: foobar', true, 201);
http_response_code(201);
header('HTTP/1.1 201 Created', true, 201);
Expected result:
----------------
It's supposed to be possible to set the Location header and have a status 3** OR 201. At the very least php's own docs confirm this: https://secure.php.net/manual/en/function.header.php
Actual result:
--------------
Setting the Location header results in a 302 no matter what I try to the contrary.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 09:00:01 2025 UTC |
header('Location: http://example.com/', true, 303); works for me with latest PHP-7.2 and the built-in webserver. Which SAPI do you use?