From 3c171cc92c2c62167b338b9eb79bb1ff973fd356 Mon Sep 17 00:00:00 2001 From: wn_ Date: Sat, 23 Dec 2023 19:52:56 +0000 Subject: Add some tests for UrlHelper::fetch() --- classes/UrlHelper.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'classes/UrlHelper.php') diff --git a/classes/UrlHelper.php b/classes/UrlHelper.php index e6b3b0aad..d088a355b 100644 --- a/classes/UrlHelper.php +++ b/classes/UrlHelper.php @@ -18,7 +18,7 @@ class UrlHelper { static string $fetch_effective_url; static string $fetch_effective_ip_addr; - private static ?GuzzleHttp\ClientInterface $client = null; + public static ?GuzzleHttp\ClientInterface $client = null; private static function get_client(): GuzzleHttp\ClientInterface { if (self::$client == null) { @@ -385,8 +385,7 @@ class UrlHelper { // If credentials were provided and we got a 403 back, retry once with auth type 'any' // to attempt compatibility with unusual configurations. - if ($login && $pass && self::$fetch_last_error_code === 403 - && isset($options['auth_type']) && $options['auth_type'] !== 'any') { + if ($login && $pass && self::$fetch_last_error_code === 403 && $auth_type !== 'any') { $options['auth_type'] = 'any'; $span->end(); return self::fetch($options); -- cgit v1.2.3