summaryrefslogtreecommitdiff
path: root/classes
diff options
context:
space:
mode:
authorwn_ <[email protected]>2023-12-23 19:52:56 +0000
committerwn_ <[email protected]>2023-12-23 19:52:56 +0000
commit3c171cc92c2c62167b338b9eb79bb1ff973fd356 (patch)
tree26561d34106e9ffc0ef7245eb2bb4b6fc7855c19 /classes
parente33b0297d59a47fc5819ce79bdf71d29ad5e88b5 (diff)
Add some tests for UrlHelper::fetch()
Diffstat (limited to 'classes')
-rw-r--r--classes/UrlHelper.php5
1 files changed, 2 insertions, 3 deletions
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);