Compare commits
2 Commits
9895fd6a70
...
8796762cfe
Author | SHA1 | Date | |
---|---|---|---|
8796762cfe | |||
99c9952c93 |
@ -25,8 +25,8 @@ class Authentication
|
||||
return $handler->handle($request);
|
||||
}
|
||||
$this->logger->notice("Not logged in.", [
|
||||
'REMOTE_ADDR' => $request->getServerParams()['REMOTE_ADDR'],
|
||||
'REQUEST_URI' => $request->getServerParams()['REQUEST_URI']
|
||||
'Server' => $request->getServerParams(),
|
||||
'Headers' => $request->getHeaders(),
|
||||
]);
|
||||
$response = $this->responseFactory->createResponse(307, 'Not logged in')
|
||||
->withHeader('Referer', (string) $request->getUri())
|
||||
|
@ -18,7 +18,11 @@ class NotAllowed
|
||||
{
|
||||
try {
|
||||
return $handler->handle($request);
|
||||
} catch (HttpMethodNotAllowedException) {
|
||||
} catch (HttpMethodNotAllowedException $exception) {
|
||||
$this->logger->warning($exception, [
|
||||
'Server' => $request->getServerParams(),
|
||||
'Headers' => $request->getHeaders(),
|
||||
]);
|
||||
$response = $this->responseFactory->createResponse(405, 'Method Not Allowed');
|
||||
if (str_contains($request->getUri()->getPath(), '/api')) {
|
||||
return $response;
|
||||
|
@ -21,7 +21,10 @@ class NotFound
|
||||
return $handler->handle($request);
|
||||
} catch (HttpNotFoundException |
|
||||
EmptyRedis | EmptyResult | Read | Create | Update | Delete $exception) {
|
||||
$this->logger->notice($exception);
|
||||
$this->logger->notice($exception, [
|
||||
'Server' => $request->getServerParams(),
|
||||
'Headers' => $request->getHeaders(),
|
||||
]);
|
||||
$response = $this->responseFactory->createResponse(404, 'Not Found');
|
||||
if (str_contains($request->getUri()->getPath(), '/api')) {
|
||||
return $response;
|
||||
|
Reference in New Issue
Block a user