urlapi: fix redirect to a new fragment or query (only)

The redirect logic was broken when the redirect-to URL was a relative
URL only as a fragment or query (starting with '#' or '?').

Extended test 1560 to reproduce, then verify.

Reported-by: Jeroen Ooms
Fixes #15836
Closes #15848
This commit is contained in:
Daniel Stenberg 2024-12-28 14:47:01 +01:00
parent 687a62f100
commit 66e5351e0a
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
4 changed files with 66 additions and 86 deletions

View file

@ -41,6 +41,9 @@ order to try out server implementations.
By default libcurl normalizes such sequences before using the path.
This is a request for the *first* request libcurl issues. When following
redirects, it may no longer apply.
The corresponding flag for the curl_url_set(3) function is called
**CURLU_PATH_AS_IS**.