diff options
author | wn_ <[email protected]> | 2023-12-23 15:48:02 +0000 |
---|---|---|
committer | wn_ <[email protected]> | 2023-12-23 15:56:21 +0000 |
commit | d82da74363adf4d96eb8b3f61f6eee07ee363e3a (patch) | |
tree | 2d0d97d2f7d3ca2aa7743793fe36717c4a3cf3f5 | |
parent | ff59fbd460aa549ffe959a087f892eadbbe5a2c0 (diff) |
Clean up UrlHelper::resolve_redirects().
Also: this doesn't appear to be used... but maybe in some plugin?
-rw-r--r-- | classes/UrlHelper.php | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/classes/UrlHelper.php b/classes/UrlHelper.php index e69085052..1bd7bfca1 100644 --- a/classes/UrlHelper.php +++ b/classes/UrlHelper.php @@ -205,15 +205,15 @@ class UrlHelper { $response = $client->request('HEAD', $url, [ GuzzleHttp\RequestOptions::CONNECT_TIMEOUT => $timeout ?: Config::get(Config::FILE_FETCH_CONNECT_TIMEOUT), GuzzleHttp\RequestOptions::TIMEOUT => $timeout ?: Config::get(Config::FILE_FETCH_TIMEOUT), - GuzzleHttp\RequestOptions::ALLOW_REDIRECTS => ['max' => 10, 'track_redirects' => true, 'http_errors' => false], + GuzzleHttp\RequestOptions::ALLOW_REDIRECTS => ['max' => 10, 'track_redirects' => true], + GuzzleHttp\RequestOptions::HTTP_ERRORS => false, GuzzleHttp\RequestOptions::HEADERS => [ 'User-Agent' => Config::get_user_agent(), 'Connection' => 'close', ], ]); - } catch (GuzzleHttp\Exception\GuzzleException $ex) { - // TODO: catch just the "too many redirects" exception, and set a different 'error' for general issues - $span->setAttribute('error', 'too many redirects'); + } catch (Exception $ex) { + $span->setAttribute('error', (string) $ex); $span->end(); return false; } |