Bug #77155 [NEW]: Location header no longer coexists with status 201
| From: | marnick dot leau at gmail dot com | Date: | Wed, 14 Nov 2018 19:26:24 +0000 |
| Subject: | Bug #77155 [NEW]: Location header no longer coexists with status 201 | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-217959@lists.php.net to get a copy of this message | ||
From: marnick dot leau at gmail dot com
Operating system: Linux
PHP version: 7.2.12
Package: HTTP related
Bug Type: Bug
Bug description:Location header no longer coexists with status 201
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.
--
Edit bug report at https://bugs.php.net/bug.php?id=77155&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=77155&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=77155&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=77155&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=77155&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=77155&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=77155&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=77155&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=77155&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=77155&r=support
Expected behavior: https://bugs.php.net/fix.php?id=77155&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=77155&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=77155&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=77155&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=77155&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=77155&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=77155&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=77155&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=77155&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=77155&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=77155&r=mysqlcfg