mirror of
https://github.com/elyby/oauth2-server.git
synced 2024-12-02 19:51:03 +05:30
No need to use Zend\Diactoros\Stream
This commit is contained in:
parent
bd12c8b1a9
commit
15b6506644
@ -6,7 +6,6 @@ use League\OAuth2\Server\Exception\OAuthServerException;
|
|||||||
use League\OAuth2\Server\Server;
|
use League\OAuth2\Server\Server;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Zend\Diactoros\Stream;
|
|
||||||
|
|
||||||
class AuthenticationServerMiddleware
|
class AuthenticationServerMiddleware
|
||||||
{
|
{
|
||||||
@ -40,10 +39,8 @@ class AuthenticationServerMiddleware
|
|||||||
return $exception->generateHttpResponse($response);
|
return $exception->generateHttpResponse($response);
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
$body = new Stream('php://temp', 'r+');
|
$response->getBody()->write($exception->getMessage());
|
||||||
$body->write($exception->getMessage());
|
return $response->withStatus(500);
|
||||||
|
|
||||||
return $response->withStatus(500)->withBody($body);
|
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -6,7 +6,6 @@ use League\OAuth2\Server\Exception\OAuthServerException;
|
|||||||
use League\OAuth2\Server\Server;
|
use League\OAuth2\Server\Server;
|
||||||
use Psr\Http\Message\ResponseInterface;
|
use Psr\Http\Message\ResponseInterface;
|
||||||
use Psr\Http\Message\ServerRequestInterface;
|
use Psr\Http\Message\ServerRequestInterface;
|
||||||
use Zend\Diactoros\Stream;
|
|
||||||
|
|
||||||
class ResourceServerMiddleware
|
class ResourceServerMiddleware
|
||||||
{
|
{
|
||||||
@ -40,10 +39,8 @@ class ResourceServerMiddleware
|
|||||||
return $exception->generateHttpResponse($response);
|
return $exception->generateHttpResponse($response);
|
||||||
// @codeCoverageIgnoreStart
|
// @codeCoverageIgnoreStart
|
||||||
} catch (\Exception $exception) {
|
} catch (\Exception $exception) {
|
||||||
$body = new Stream('php://temp', 'r+');
|
$response->getBody()->write($exception->getMessage());
|
||||||
$body->write($exception->getMessage());
|
return $response->withStatus(500);
|
||||||
|
|
||||||
return $response->withStatus(500)->withBody($body);
|
|
||||||
// @codeCoverageIgnoreEnd
|
// @codeCoverageIgnoreEnd
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user