Use "HttpClientOptions"

This commit is contained in:
Michael 2022-03-29 08:57:38 +00:00
parent 1fae0123ec
commit 908d2594ed
5 changed files with 9 additions and 7 deletions

View file

@ -267,9 +267,9 @@ class HttpClient implements ICanSendHttpRequests
return $this->get(
$url,
[
'timeout' => $timeout,
'accept_content' => $accept_content,
'cookiejar' => $cookiejar
HttpClientOptions::TIMEOUT => $timeout,
HttpClientOptions::ACCEPT_CONTENT => $accept_content,
HttpClientOptions::COOKIEJAR => $cookiejar
]
);
}

View file

@ -932,7 +932,7 @@ class Probe
{
$xrd_timeout = DI::config()->get('system', 'xrd_timeout', 20);
$curlResult = DI::httpClient()->get($url, [HttpClientOptions::TIMEOUT => $xrd_timeout, HttpClientOptions::ACCEPT_CONTENT => [$type]]);
$curlResult = DI::httpClient()->get($url, [HttpClientOptions::TIMEOUT => $xrd_timeout, HttpClientOptions::ACCEPT_CONTENT => $type]);
if ($curlResult->isTimeout()) {
self::$istimeout = true;
return [];