Skip to content

Commit

Permalink
[7.x] Fixes using ChromeDriverCommand with Telescope (#1050)
Browse files Browse the repository at this point in the history
* [7.x] Fixes using `ChromeDriverCommand` with Telescope

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>

* Update ChromeDriverCommand.php

---------

Signed-off-by: Mior Muhammad Zaki <crynobone@gmail.com>
Co-authored-by: Taylor Otwell <taylor@laravel.com>
  • Loading branch information
crynobone and taylorotwell authored Jul 30, 2023
1 parent ffdc013 commit 9af939b
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions src/Console/ChromeDriverCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
namespace Laravel\Dusk\Console;

use Exception;
use GuzzleHttp\Client;
use GuzzleHttp\Psr7\Utils;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Http;
Expand Down Expand Up @@ -192,12 +193,18 @@ protected function download($version, $os)

$resource = Utils::tryFopen($archive = $this->directory.'chromedriver.zip', 'w');

Http::withOptions(array_merge([
'verify' => $this->option('ssl-no-verify') === false,
$client = new Client();

$response = $client->get($url, array_merge([
'sink' => $resource,
]), array_filter([
'verify' => $this->option('ssl-no-verify') === false,
], array_filter([
'proxy' => $this->option('proxy'),
]))->get($url);
])));

if ($response->getStatusCode() < 200 || $response->getStatusCode() > 299) {
throw new Exception("Unable to download ChromeDriver from [{$url}].");
}

return $archive;
}
Expand Down Expand Up @@ -306,8 +313,8 @@ protected function getUrl(string $url)
{
return Http::withOptions(array_merge([
'verify' => $this->option('ssl-no-verify') === false,
]), array_filter([
], array_filter([
'proxy' => $this->option('proxy'),
]))->get($url)->body();
])))->get($url)->body();
}
}

2 comments on commit 9af939b

@CamKem
Copy link

@CamKem CamKem commented on 9af939b Jul 31, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Has this fix been published? I am still getting this error locally running 7.9.1.

@driesvints
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah it's in 7.9.2

Please sign in to comment.