Catch TransferExceptions for HTTPClient::finalUrl() in case the headers are empty

This commit is contained in:
Philipp 2021-08-29 13:37:08 +02:00
parent e88c12d958
commit b76634ea0c
No known key found for this signature in database
GPG key ID: 9A28B7D4FF5667BD
3 changed files with 11 additions and 3 deletions

View file

@ -220,7 +220,7 @@ class HTTPClient implements IHTTPClient
$urlResult = $this->resolver->resolveURL($url);
if ($urlResult->didErrorOccur()) {
throw new TransferException($urlResult->getErrorMessageString());
throw new TransferException($urlResult->getErrorMessageString(), $urlResult->getHTTPStatusCode());
}
return $urlResult->getURL();