mirror of
https://github.com/curl/curl.git
synced 2026-08-25 10:53:37 +03:00
urlapi: detect scheme better when not guessing
When the parser is not allowed to guess scheme, it should consider the word ending at the first colon to be the scheme, independently of number of slashes. The parser now checks that the scheme is known before it counts slashes, to improve the error messge for URLs with unknown schemes and maybe no slashes. When following redirects, no scheme guessing is allowed and therefore this change effectively prevents redirects to unknown schemes such as "data". Fixes #9503
This commit is contained in:
parent
7f5fe74323
commit
846678541b
4 changed files with 30 additions and 14 deletions
|
|
@ -1995,7 +1995,7 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
|||
return CURLE_OUT_OF_MEMORY;
|
||||
|
||||
if(data->set.str[STRING_DEFAULT_PROTOCOL] &&
|
||||
!Curl_is_absolute_url(data->state.url, NULL, 0)) {
|
||||
!Curl_is_absolute_url(data->state.url, NULL, 0, TRUE)) {
|
||||
char *url = aprintf("%s://%s", data->set.str[STRING_DEFAULT_PROTOCOL],
|
||||
data->state.url);
|
||||
if(!url)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue