-
Notifications
You must be signed in to change notification settings - Fork 12
Conversation
Waiting for stackphp/CallableHttpKernel#3 to add missing tests. |
Do we need to terminate them based on them being matched? I'm not sure, related to stackphp/builder#14 |
The goal of UrlMap stack is to manage only one matching app, so I think we should apply the same logic in |
But it's one matching app per request, the HttpCache middleware could and would fire multiple requests through the app before terminate happens. |
Good point ;) I updated the PR accordingly. |
I tested the |
Just thought of a really minor thing, perhaps we should keep track of the apps that have been terminated, something like: $terminated = [];
foreach ($this->map as $path => $app) {
if ($app instanceof TerminableInterface && !in_array($app, $terminated, true)) {
$app->terminate($request, $response);
$terminated[] = $app;
}
} Not sure if that would be overkill. I personally think terminate should be idempotent, so shouldn't matter. |
|
||
public function terminate(Request $request, Response $response) | ||
{ | ||
$pathInfo = rawurldecode($request->getPathInfo()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this should no longer be needed
Thanks! |
Add
UrlMap::terminate()
method.