Updated to guzzle 7

This commit is contained in:
Alejandro Celaya
2020-06-28 10:06:49 +02:00
parent 509672f4c7
commit 73c6c52b2a
3 changed files with 10 additions and 7 deletions

View File

@@ -37,6 +37,7 @@ class UrlValidator implements UrlValidatorInterface, RequestMethodInterface
try {
$this->httpClient->request(self::METHOD_GET, $url, [
RequestOptions::ALLOW_REDIRECTS => ['max' => self::MAX_REDIRECTS],
RequestOptions::IDN_CONVERSION => true,
]);
} catch (GuzzleException $e) {
throw InvalidUrlException::fromUrl($url, $e);

View File

@@ -48,7 +48,10 @@ class UrlValidatorTest extends TestCase
$request = $this->httpClient->request(
RequestMethodInterface::METHOD_GET,
$expectedUrl,
[RequestOptions::ALLOW_REDIRECTS => ['max' => 15]],
[
RequestOptions::ALLOW_REDIRECTS => ['max' => 15],
RequestOptions::IDN_CONVERSION => true,
],
)->willReturn(new Response());
$this->urlValidator->validateUrl($expectedUrl);