fix: reset sapi response code (#964)

* fix: reset sapi response code
It turns out that the sapi response code is NOT reset between requests by the zend engine. This resets the code for cgi-based requests.
fixes: #960

* update response header test

* fix assertion

* appears to affect workers too
This commit is contained in:
Rob Landers
2024-08-11 22:34:50 +02:00
committed by GitHub
parent 3ca52f5934
commit d532772355
3 changed files with 13 additions and 2 deletions

View File

@@ -7,7 +7,9 @@ return function () {
header('Foo2: bar2');
header('Invalid');
header('I: ' . ($_GET['i'] ?? 'i not set'));
http_response_code(201);
if ($_GET['i'] % 3) {
http_response_code($_GET['i'] + 100);
}
var_export(apache_response_headers());
};