mirror of
https://github.com/curl/curl.git
synced 2026-06-05 14:54:14 +03:00
url: provide better error message when URLs fail to parse
By providing the URL API error message into the error message. Ref: #11129 Closes #11137
This commit is contained in:
parent
88ba931daa
commit
f1e5d8a731
1 changed files with 8 additions and 8 deletions
16
lib/url.c
16
lib/url.c
|
|
@ -1755,14 +1755,13 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||
if(!use_set_uh) {
|
||||
char *newurl;
|
||||
uc = curl_url_set(uh, CURLUPART_URL, data->state.url,
|
||||
CURLU_GUESS_SCHEME |
|
||||
CURLU_NON_SUPPORT_SCHEME |
|
||||
(data->set.disallow_username_in_url ?
|
||||
CURLU_DISALLOW_USER : 0) |
|
||||
(data->set.path_as_is ? CURLU_PATH_AS_IS : 0));
|
||||
CURLU_GUESS_SCHEME |
|
||||
CURLU_NON_SUPPORT_SCHEME |
|
||||
(data->set.disallow_username_in_url ?
|
||||
CURLU_DISALLOW_USER : 0) |
|
||||
(data->set.path_as_is ? CURLU_PATH_AS_IS : 0));
|
||||
if(uc) {
|
||||
DEBUGF(infof(data, "curl_url_set rejected %s: %s", data->state.url,
|
||||
curl_url_strerror(uc)));
|
||||
failf(data, "URL rejected: %s", curl_url_strerror(uc));
|
||||
return Curl_uc_to_curlcode(uc);
|
||||
}
|
||||
|
||||
|
|
@ -2176,7 +2175,8 @@ static CURLcode parse_proxy(struct Curl_easy *data,
|
|||
}
|
||||
}
|
||||
else {
|
||||
failf(data, "Unsupported proxy syntax in \'%s\'", proxy);
|
||||
failf(data, "Unsupported proxy syntax in \'%s\': %s", proxy,
|
||||
curl_url_strerror(uc));
|
||||
result = CURLE_COULDNT_RESOLVE_PROXY;
|
||||
goto error;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue