From af1900fb11c68116eb8a90dcab00a61e634f332a Mon Sep 17 00:00:00 2001 From: Viktor Masicek Date: Tue, 9 Jul 2024 10:24:55 +0200 Subject: [PATCH] Log used HTTP method on not allowed method (error 405) (cherry picked from commit b69c27f7eb208d6bdd41257b8e964da4e1df2c6b) --- src/ApiRoute.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ApiRoute.php b/src/ApiRoute.php index 92e14d4..a1ffaa0 100755 --- a/src/ApiRoute.php +++ b/src/ApiRoute.php @@ -113,7 +113,7 @@ public function resolveMethod(Nette\Http\IRequest $request): string { if (!in_array($request->getMethod(), $this->getMethods(), true)) { throw new ClientException( - 'Allowed methods: ' . implode(', ', $this->getMethods()) . '.', + 'Allowed methods: ' . implode(', ', $this->getMethods()) . '. Used method: ' . $request->getMethod() . '.', Nette\Http\IResponse::S405_MethodNotAllowed ); }