Fix header writing

master v1.0.1
eater 7 years ago
parent 213671b00b
commit 8470de671d
Signed by: eater
GPG Key ID: AD2560A0F84F0759

@ -88,11 +88,12 @@ class Server
header('HTTP/' . $response->getProtocolVersion() . ' ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase());
$wrote = [];
foreach ($response->getHeaders() as [$headerName, $headerValue]) {
// Only replace header if we didn't write on those yet
header($headerName . ': ' . $headerValue, !isset($wrote[$headerName]));
$wrote[$headerName] = true;
foreach ($response->getHeaders() as $headerName => $headerValues) {
$first = true;
foreach ($headerValues as $headerValue) {
header($headerName . ': ' . $headerValue, $first === true);
$first = false;
}
}
$stdout = fopen('php://output', 'w+');

Loading…
Cancel
Save