-
Notifications
You must be signed in to change notification settings - Fork 36
Skip action if response already sent by init hook #234
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -693,7 +693,7 @@ public function match(Request $request, bool $fresh = true): ?Route | |
| * @param Route $route | ||
| * @param Request $request | ||
| */ | ||
| public function execute(Route $route, Request $request): static | ||
| public function execute(Route $route, Request $request, Response $response): static | ||
| { | ||
| $arguments = []; | ||
| $groups = $route->getGroups(); | ||
|
|
@@ -720,8 +720,10 @@ public function execute(Route $route, Request $request): static | |
| } | ||
| } | ||
|
|
||
| $arguments = $this->getArguments($route, $pathValues, $request->getParams()); | ||
| \call_user_func_array($route->getAction(), $arguments); | ||
| if (!$response->isSent()) { | ||
| $arguments = $this->getArguments($route, $pathValues, $request->getParams()); | ||
| \call_user_func_array($route->getAction(), $arguments); | ||
| } | ||
|
Comment on lines
+723
to
+726
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The PR description lists three test-plan items (all unchecked). There is no new test case in |
||
|
|
||
| foreach ($groups as $group) { | ||
| foreach (self::$shutdown as $hook) { // Group shutdown hooks | ||
|
|
@@ -953,7 +955,7 @@ private function runInternal(Request $request, Response $response): static | |
| } | ||
|
|
||
| if (null !== $route) { | ||
| return $this->execute($route, $request); | ||
| return $this->execute($route, $request, $response); | ||
| } elseif (self::REQUEST_METHOD_OPTIONS == $method) { | ||
| try { | ||
| foreach ($groups as $group) { | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.