urlapi: respect CURLU_ALLOW_SPACE and CURLU_NO_AUTHORITY for redirects

curl_url_set(uh, CURLUPART_URL, redirurl, flags)  was not respecing
CURLU_ALLOW_SPACE and CURLU_NO_AUTHORITY in the host part of redirurl
when redirecting to an absolute URL.

Closes #11136
This commit is contained in:
Emanuele Torre 2023-05-18 10:48:19 +02:00 committed by Daniel Stenberg
parent e743425bc6
commit df6c2f7b54
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 18 additions and 6 deletions

View file

@ -984,6 +984,14 @@ static const struct redircase set_url_list[] = {
"../newpage",
"http://user:foo@example.com/newpage",
0, 0, CURLUE_OK},
{"http://user:foo@example.com/path?query#frag",
"http://example org/",
"http://example org/",
0, CURLU_ALLOW_SPACE, CURLUE_OK},
{"http://user:foo@example.com/path?query#frag",
"http://?hi",
"http:///?hi",
0, CURLU_NO_AUTHORITY, CURLUE_OK},
{NULL, NULL, NULL, 0, 0, CURLUE_OK}
};