diff --git a/CHANGELOG.md b/CHANGELOG.md index 387bc45..e73e71d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,5 @@ +* Added dev OverrideMethod middleware + ## v0.2.15 (2023-12-11) * Fixed Dispatcher add() signature diff --git a/src/Middleware/OverrideMethod.php b/src/Middleware/OverrideMethod.php new file mode 100644 index 0000000..c42bfec --- /dev/null +++ b/src/Middleware/OverrideMethod.php @@ -0,0 +1,55 @@ +isDevelopment(); + } else { + $development = true; + } + + + if ( + $development && + ($method = ($request->getQueryParams()['method'] ?? null)) !== null + ) { + $request = $request->withMethod($method); + } + + + return $next->handle($request); + } +}