Skip to content

Commit

Permalink
fix openHandler url.
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa.seef-aldeen committed Aug 24, 2023
1 parent 14d6baf commit 9a06f87
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/DebugBarMiddleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public function __construct(
*/
public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface
{
$this->setConfigOptions();
$this->setConfigOptions($request);
//Asset response
if ($assetResponse = $this->getAssetResponse($request)) {
return $assetResponse;
Expand Down Expand Up @@ -105,7 +105,7 @@ public function process(ServerRequestInterface $request, RequestHandlerInterface
return $response;
}

private function setConfigOptions(): void
private function setConfigOptions(ServerRequestInterface $request): void
{
$this->renderer = $this->debugBar->getJavascriptRenderer();
$renderOptions = $this->debugBarConfig[ 'javascript_renderer' ] ?? [];
Expand All @@ -124,7 +124,9 @@ private function setConfigOptions(): void
$this->renderer->setBindAjaxHandlerToXHR();
}
if ($this->captureAjax) {
$this->renderer->setOpenHandlerUrl(ConfigProvider::OPEN_HANDLER_URL);
$uri = $request->getUri();
$url = $uri->getScheme() . '://' . $uri->getHost() . '/' . ConfigProvider::OPEN_HANDLER_URL;
$this->renderer->setOpenHandlerUrl($url);
}
}

Expand Down

0 comments on commit 9a06f87

Please sign in to comment.