Curl_follow: accept non-supported schemes for "fake" redirects

When not actually following the redirect and the target URL is only
stored for later retrieval, curl always accepted "non-supported"
schemes. This was a regression from 46e164069d.

Reported-by: Brad King
Fixes #3210
Closes #3215
This commit is contained in:
Daniel Stenberg 2018-11-01 23:45:57 +01:00
parent a4653a7fa2
commit 2c5ec339ea
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
3 changed files with 61 additions and 2 deletions

View file

@ -1514,7 +1514,8 @@ CURLcode Curl_follow(struct Curl_easy *data,
disallowport = TRUE;
DEBUGASSERT(data->state.uh);
uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl, 0);
uc = curl_url_set(data->state.uh, CURLUPART_URL, newurl,
(type == FOLLOW_FAKE) ? CURLU_NON_SUPPORT_SCHEME : 0);
if(uc)
return Curl_uc_to_curlcode(uc);