Extras ya enviados por processor

This commit is contained in:
Juan Pablo Vial
2025-06-03 11:52:31 -04:00
parent 300d966f3f
commit 02665ac6bd
3 changed files with 3 additions and 42 deletions

View File

@ -24,20 +24,7 @@ class Authentication
if ($this->service->isIn() or $this->isValid($request)) { if ($this->service->isIn() or $this->isValid($request)) {
return $handler->handle($request); return $handler->handle($request);
} }
$serverFilters = [ $this->logger->notice("Not logged in.");
'HTTP_',
'QUERY_',
'REDIRECT_',
'REMOTE_',
'REQUEST_',
];
$serverParams = array_filter($request->getServerParams(),
fn($key) => count(array_filter($serverFilters, fn($prefix) => str_starts_with($key, $prefix))) > 0,
ARRAY_FILTER_USE_KEY);
$this->logger->notice("Not logged in.", [
'Server' => $serverParams,
'Headers' => $request->getHeaders(),
]);
$response = $this->responseFactory->createResponse(307, 'Not logged in') $response = $this->responseFactory->createResponse(307, 'Not logged in')
->withHeader('Referer', (string) $request->getUri()) ->withHeader('Referer', (string) $request->getUri())
->withHeader('X-Redirected-URI', (string) $request->getUri()); ->withHeader('X-Redirected-URI', (string) $request->getUri());

View File

@ -19,20 +19,7 @@ class NotAllowed
try { try {
return $handler->handle($request); return $handler->handle($request);
} catch (HttpMethodNotAllowedException $exception) { } catch (HttpMethodNotAllowedException $exception) {
$serverFilters = [ $this->logger->warning($exception);
'HTTP_',
'QUERY_',
'REDIRECT_',
'REMOTE_',
'REQUEST_',
];
$serverParams = array_filter($request->getServerParams(),
fn($key) => count(array_filter($serverFilters, fn($prefix) => str_starts_with($key, $prefix))) > 0,
ARRAY_FILTER_USE_KEY);
$this->logger->warning($exception, [
'Server' => $serverParams,
'Headers' => $request->getHeaders(),
]);
$response = $this->responseFactory->createResponse(405, 'Method Not Allowed'); $response = $this->responseFactory->createResponse(405, 'Method Not Allowed');
if (str_contains($request->getUri()->getPath(), '/api')) { if (str_contains($request->getUri()->getPath(), '/api')) {
return $response; return $response;

View File

@ -21,20 +21,7 @@ class NotFound
return $handler->handle($request); return $handler->handle($request);
} catch (HttpNotFoundException | } catch (HttpNotFoundException |
EmptyRedis | EmptyResult | Read | Create | Update | Delete $exception) { EmptyRedis | EmptyResult | Read | Create | Update | Delete $exception) {
$serverFilters = [ $this->logger->notice($exception);
'HTTP_',
'QUERY_',
'REDIRECT_',
'REMOTE_',
'REQUEST_',
];
$serverParams = array_filter($request->getServerParams(),
fn($key) => count(array_filter($serverFilters, fn($prefix) => str_starts_with($key, $prefix))) > 0,
ARRAY_FILTER_USE_KEY);
$this->logger->notice($exception, [
'Server' => $serverParams,
'Headers' => $request->getHeaders(),
]);
$response = $this->responseFactory->createResponse(404, 'Not Found'); $response = $this->responseFactory->createResponse(404, 'Not Found');
if (str_contains($request->getUri()->getPath(), '/api')) { if (str_contains($request->getUri()->getPath(), '/api')) {
return $response; return $response;