Hard to solve issue 4 "Curl error code CURLE_URL_MALFORMAT" so we log the url

This commit is contained in:
djmaze 2020-08-30 17:34:58 +02:00
parent 39ba67de4b
commit aea3389bf2
2 changed files with 5 additions and 5 deletions

View file

@ -491,13 +491,13 @@ class PdoAddressBook
$aUrl = array(); $aUrl = array();
} }
$aUrl['scheme'] = isset($aUrl['scheme']) ? $aUrl['scheme'] : 'http'; $aUrl['scheme'] = $aUrl['scheme'] ?? 'http';
$aUrl['host'] = isset($aUrl['host']) ? $aUrl['host'] : 'localhost'; $aUrl['host'] = $aUrl['host'] ?? 'localhost';
$aUrl['port'] = isset($aUrl['port']) ? $aUrl['port'] : 80; $aUrl['port'] = $aUrl['port'] ?? 0;
$aUrl['path'] = isset($aUrl['path']) ? \rtrim($aUrl['path'], '\\/').'/' : '/'; $aUrl['path'] = isset($aUrl['path']) ? \rtrim($aUrl['path'], '\\/').'/' : '/';
$aSettings = array( $aSettings = array(
'baseUri' => $aUrl['scheme'].'://'.$aUrl['host'].('80' === (string) $aUrl['port'] ? '' : ':'.$aUrl['port']), 'baseUri' => $aUrl['scheme'].'://'.$aUrl['host'].($aUrl['port'] ? ':'.$aUrl['port'] : ''),
'userName' => $sUser, 'userName' => $sUser,
'password' => $sPassword 'password' => $sPassword
); );

View file

@ -418,7 +418,7 @@ class Client {
); );
if ($curlErrNo) { if ($curlErrNo) {
throw new Exception('[CURL] Error while making request: ' . $curlError . ' (error code: ' . $curlErrNo . ')'); throw new Exception('[CURL] Error while making request: ' . $curlError . ' (error code: ' . $curlErrNo . ', uri: ' . $url . ')');
} }
if ($response['statusCode']>=400) { if ($response['statusCode']>=400) {