diff --git a/app/src/Middleware/Authentication.php b/app/src/Middleware/Authentication.php index b885396..28f3fdf 100644 --- a/app/src/Middleware/Authentication.php +++ b/app/src/Middleware/Authentication.php @@ -24,20 +24,7 @@ class Authentication if ($this->service->isIn() or $this->isValid($request)) { return $handler->handle($request); } - $serverFilters = [ - '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(), - ]); + $this->logger->notice("Not logged in."); $response = $this->responseFactory->createResponse(307, 'Not logged in') ->withHeader('Referer', (string) $request->getUri()) ->withHeader('X-Redirected-URI', (string) $request->getUri()); diff --git a/app/src/Middleware/NotAllowed.php b/app/src/Middleware/NotAllowed.php index 0f78374..ce8ba90 100644 --- a/app/src/Middleware/NotAllowed.php +++ b/app/src/Middleware/NotAllowed.php @@ -19,20 +19,7 @@ class NotAllowed try { return $handler->handle($request); } catch (HttpMethodNotAllowedException $exception) { - $serverFilters = [ - '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(), - ]); + $this->logger->warning($exception); $response = $this->responseFactory->createResponse(405, 'Method Not Allowed'); if (str_contains($request->getUri()->getPath(), '/api')) { return $response; diff --git a/app/src/Middleware/NotFound.php b/app/src/Middleware/NotFound.php index e245805..53cb4fa 100644 --- a/app/src/Middleware/NotFound.php +++ b/app/src/Middleware/NotFound.php @@ -21,20 +21,7 @@ class NotFound return $handler->handle($request); } catch (HttpNotFoundException | EmptyRedis | EmptyResult | Read | Create | Update | Delete $exception) { - $serverFilters = [ - '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(), - ]); + $this->logger->notice($exception); $response = $this->responseFactory->createResponse(404, 'Not Found'); if (str_contains($request->getUri()->getPath(), '/api')) { return $response;