also, try port 80 if 443 is not available

Signed-off-by: Maxence Lange <maxence@artificial-owl.com>
pull/545/head
Maxence Lange 2019-05-27 09:22:35 -01:00
rodzic e72748fa0d
commit 4878aa05e9
1 zmienionych plików z 9 dodań i 2 usunięć

Wyświetl plik

@ -115,7 +115,14 @@ class CurlService {
$request->addData('resource', 'acct:' . $account);
$request->setAddress($host);
$result = $this->request($request);
try {
$result = $this->request($request);
} catch (RequestNetworkException $e) {
if ($e->getCode() === CURLE_COULDNT_CONNECT) {
$request->setProtocol('http');
$result = $this->request($request);
} else throw $e;
}
return $result;
}
@ -419,7 +426,7 @@ class CurlService {
throw new RequestNetworkException(
$errno . ' - ' . curl_error($curl) . ' - ' . json_encode(
$request, JSON_UNESCAPED_SLASHES
)
), $errno
);
}
}