Fix header writing
This commit is contained in:
parent
213671b00b
commit
8470de671d
1 changed files with 6 additions and 5 deletions
|
@ -88,11 +88,12 @@ class Server
|
||||||
|
|
||||||
header('HTTP/' . $response->getProtocolVersion() . ' ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase());
|
header('HTTP/' . $response->getProtocolVersion() . ' ' . $response->getStatusCode() . ' ' . $response->getReasonPhrase());
|
||||||
|
|
||||||
$wrote = [];
|
foreach ($response->getHeaders() as $headerName => $headerValues) {
|
||||||
foreach ($response->getHeaders() as [$headerName, $headerValue]) {
|
$first = true;
|
||||||
// Only replace header if we didn't write on those yet
|
foreach ($headerValues as $headerValue) {
|
||||||
header($headerName . ': ' . $headerValue, !isset($wrote[$headerName]));
|
header($headerName . ': ' . $headerValue, $first === true);
|
||||||
$wrote[$headerName] = true;
|
$first = false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$stdout = fopen('php://output', 'w+');
|
$stdout = fopen('php://output', 'w+');
|
||||||
|
|
Loading…
Reference in a new issue