Bug #77155 [Opn->Fbk]: Location header no longer coexists with status 201

From: Date: Thu, 15 Nov 2018 13:19:10 +0000
Subject: Bug #77155 [Opn->Fbk]: Location header no longer coexists with status 201
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-217974@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77155&edit=1 ID: 77155 Updated by: cmb@php.net Reported by: marnick dot leau at gmail dot com Summary: Location header no longer coexists with status 201 -Status: Open +Status: Feedback Type: Bug Package: HTTP related Operating System: Linux PHP Version: 7.2.12 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N New Comment: 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? Previous Comments: ------------------------------------------------------------------------ [2018-11-14 19:26:24] 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. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77155&edit=1

« previous php.bugs (#217974) next »