mirror of
https://github.com/elyby/oauth2-server.git
synced 2025-03-12 19:29:18 +05:30
stream write fix
This commit is contained in:
parent
ef5904ab1a
commit
b7b1f56d0c
@ -243,9 +243,9 @@ class OAuthServerException extends \Exception
|
|||||||
$response = $response->withHeader($header, $content);
|
$response = $response->withHeader($header, $content);
|
||||||
}
|
}
|
||||||
|
|
||||||
$response = $response->withStatus($this->getHttpStatusCode());
|
|
||||||
$response->getBody()->write(json_encode($payload));
|
$response->getBody()->write(json_encode($payload));
|
||||||
return $response;
|
|
||||||
|
return $response->withStatus($this->getHttpStatusCode());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,7 +38,9 @@ class AuthenticationServerMiddleware
|
|||||||
} catch (OAuthServerException $exception) {
|
} catch (OAuthServerException $exception) {
|
||||||
return $exception->generateHttpResponse($response);
|
return $exception->generateHttpResponse($response);
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
return $response->withStatus(500)->write($exception->getMessage());
|
$response->getBody()->write($exception->getMessage());
|
||||||
|
|
||||||
|
return $response->withStatus(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($response->getStatusCode(), [400, 401, 500])) {
|
if (in_array($response->getStatusCode(), [400, 401, 500])) {
|
||||||
|
@ -38,7 +38,9 @@ class ResourceServerMiddleware
|
|||||||
} catch (OAuthServerException $exception) {
|
} catch (OAuthServerException $exception) {
|
||||||
return $exception->generateHttpResponse($response);
|
return $exception->generateHttpResponse($response);
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
return $response->withStatus(500)->write($exception->getMessage());
|
$response->getBody()->write($exception->getMessage());
|
||||||
|
|
||||||
|
return $response->withStatus(500);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Pass the request and response on to the next responder in the chain
|
// Pass the request and response on to the next responder in the chain
|
||||||
|
Loading…
x
Reference in New Issue
Block a user