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

Commit

Permalink
correct way to mock headers
Browse files Browse the repository at this point in the history
  • Loading branch information
SQKo committed Apr 16, 2022
1 parent 57f1828 commit 8087ddd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Discord/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,11 @@ public function runCgi()
$serverRequest = (new \Kambo\Http\Message\Factories\Environment\ServerRequestFactory())->create($environment);

$this->handleRequest($serverRequest)->then(function (Response $response) {
header('Content-Type: application/json'); // Workaround
foreach ($response->getHeaders() as $name => $values) {
foreach ($values as $value) {
header(sprintf('%s: %s', $name, $value), false);
}
}
http_response_code($response->getStatusCode());
echo (string) $response->getBody();
});
Expand Down

0 comments on commit 8087ddd

Please sign in to comment.