diff --git a/src/Exception/OAuthServerException.php b/src/Exception/OAuthServerException.php index f97e3b5a..982c8f73 100644 --- a/src/Exception/OAuthServerException.php +++ b/src/Exception/OAuthServerException.php @@ -226,14 +226,12 @@ class OAuthServerException extends \Exception } foreach ($headers as $header => $content) { - $response->withHeader($header, $content); + $response = $response->withHeader($header, $content); } - $response + return $response ->withStatus($this->getHttpStatusCode()) ->getBody()->write(json_encode($payload)); - - return $response; } /**