Skip to content
This repository was archived by the owner on Feb 18, 2023. It is now read-only.

Commit 8087ddd

Browse files
committed
correct way to mock headers
1 parent 57f1828 commit 8087ddd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/Discord/Client.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,11 @@ public function runCgi()
313313
$serverRequest = (new \Kambo\Http\Message\Factories\Environment\ServerRequestFactory())->create($environment);
314314

315315
$this->handleRequest($serverRequest)->then(function (Response $response) {
316-
header('Content-Type: application/json'); // Workaround
316+
foreach ($response->getHeaders() as $name => $values) {
317+
foreach ($values as $value) {
318+
header(sprintf('%s: %s', $name, $value), false);
319+
}
320+
}
317321
http_response_code($response->getStatusCode());
318322
echo (string) $response->getBody();
319323
});

0 commit comments

Comments
 (0)