Skip to content

Commit

Permalink
Merge pull request #2 from XCame/hotfix/url-scoped-container
Browse files Browse the repository at this point in the history
Prevent race-condition of two requests on same action with different route params
  • Loading branch information
weierophinney authored Apr 13, 2021
2 parents 660ead1 + 1164635 commit 998d22b
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/PostRedirectGet.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,25 @@ public function __invoke($redirect = null, $redirectToUrl = false)
return false;
}

/**
*
* @return string
*/
public function getContainerIdentifier()
{
$controller = $this->getController();
$request = $controller->getRequest();

return md5($request->getUri());
}

/**
* @return Container
*/
public function getSessionContainer()
{
if (! $this->sessionContainer) {
$this->sessionContainer = new Container('prg_post1');
$this->sessionContainer = new Container($this->getContainerIdentifier());
}
return $this->sessionContainer;
}
Expand Down

0 comments on commit 998d22b

Please sign in to comment.