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

@ -24,7 +24,7 @@
"doctrine/orm": "^2.7",
"endroid/qr-code": "^3.6",
"geoip2/geoip2": "^2.9",
"guzzlehttp/guzzle": "^6.5.1",
"guzzlehttp/guzzle": "^7.0",
"laminas/laminas-config": "^3.3",
"laminas/laminas-config-aggregator": "^1.1",
"laminas/laminas-dependency-plugin": "^1.0",
@ -50,18 +50,17 @@
"predis/predis": "^1.1",
"pugx/shortid-php": "^0.5",
"ramsey/uuid": "^3.9",
"shlinkio/shlink-common": "^3.1.0",
"shlinkio/shlink-common": "^3.2.0",
"shlinkio/shlink-config": "^1.0",
"shlinkio/shlink-event-dispatcher": "^1.4",
"shlinkio/shlink-installer": "^5.1.0",
"shlinkio/shlink-ip-geolocation": "^1.4",
"shlinkio/shlink-ip-geolocation": "^1.5",
"symfony/console": "^5.1",
"symfony/filesystem": "^5.1",
"symfony/lock": "^5.1",
"symfony/mercure": "^0.3.0",
"symfony/process": "^5.1",
"symfony/string": "^5.1",
"symfony/translation-contracts": "^2.1"
"symfony/string": "^5.1"
},
"require-dev": {
"devster/ubench": "^2.0",
@ -72,7 +71,7 @@
"phpunit/phpunit": "~9.0.1",
"roave/security-advisories": "dev-master",
"shlinkio/php-coding-standard": "~2.1.0",
"shlinkio/shlink-test-utils": "^1.4",
"shlinkio/shlink-test-utils": "^1.5",
"symfony/var-dumper": "^5.0"
},
"autoload": {

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);