Skip to content

Commit

Permalink
Support Modern Remote Chrome
Browse files Browse the repository at this point in the history
Starting in version 66, Chrome DevTools requires the host header to be “localhost” or an IP address. Work around this by setting the header to “lcoalhost” when fetching the version endpoint.
  • Loading branch information
srvrguy committed Jul 1, 2024
1 parent e249ed4 commit 3418b1f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion library/Pdfexport/HeadlessChrome.php
Original file line number Diff line number Diff line change
Expand Up @@ -755,7 +755,7 @@ public function getVersion()
protected function jsonVersion($host, $port)
{
$client = new \GuzzleHttp\Client();
$response = $client->request('GET', sprintf('http://%s:%s/json/version', $host, $port));
$response = $client->request('GET', sprintf('http://%s:%s/json/version', $host, $port), ['headers' => ['Host' => 'localhost']]);

if ($response->getStatusCode() !== 200) {
return false;
Expand Down

0 comments on commit 3418b1f

Please sign in to comment.