Skip to content

Commit

Permalink
Merge pull request #84 from utopia-php/fix-race-condition
Browse files Browse the repository at this point in the history
fix: race condition for request/response resources
  • Loading branch information
christyjacob4 authored Nov 23, 2022
2 parents f5d2f05 + 55fe8fc commit 2391b39
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -679,6 +679,9 @@ protected function getArguments(Hook $hook, array $values, array $requestParams)
*/
public function run(Request $request, Response $response): static
{
$this->resources['request'] = $request;
$this->resources['response'] = $response;

self::setResource('request', function () use ($request) {
return $request;
});
Expand Down

0 comments on commit 2391b39

Please sign in to comment.