urlapi: URL encoding for the URL missed the fragment

Meaning that it would wrongly still store the fragment using spaces
instead of %20 if allowing space while also asking for URL encoding.

Discovered when playing with trurl.

Added test to lib1560 to verify the fix.

Closes #10887
This commit is contained in:
Daniel Stenberg 2023-04-04 16:59:59 +02:00
parent 4399a532e9
commit f042e1e75d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
2 changed files with 21 additions and 7 deletions

View file

@ -141,6 +141,9 @@ struct clearurlcase {
};
static const struct testcase get_parts_list[] ={
{"https://user@example.net?hello# space ",
"https | user | [12] | [13] | example.net | [15] | / | hello | %20space%20",
CURLU_ALLOW_SPACE|CURLU_URLENCODE, 0, CURLUE_OK},
{"https://test%test", "", 0, 0, CURLUE_BAD_HOSTNAME},
{"https://example.com%252f%40@example.net",
"https | example.com%2f@ | [12] | [13] | example.net | [15] | / "