mirror of
https://github.com/curl/curl.git
synced 2026-06-04 18:44:16 +03:00
urlapi: drop base fragment on empty redirect
Extended test 1560 to verify Fixes #21745 Closes #21763
This commit is contained in:
parent
4ff212f8ed
commit
780ccb256e
3 changed files with 33 additions and 3 deletions
|
|
@ -1721,8 +1721,11 @@ static CURLUcode set_url(CURLU *u, const char *url, size_t part_size,
|
|||
and this is a redirect */
|
||||
uc = curl_url_get(u, CURLUPART_URL, &oldurl, flags);
|
||||
if(!uc) {
|
||||
/* success, meaning the "" is a fine relative URL, but nothing
|
||||
changes */
|
||||
/* success, meaning the "" is a fine relative URL, and the new URL
|
||||
inherits scheme/authority/path/query, but not fragment, from the
|
||||
existing URL (RFC 3986 section 5.2.2) */
|
||||
curlx_safefree(u->fragment);
|
||||
u->fragment_present = FALSE;
|
||||
curlx_free(oldurl);
|
||||
return CURLUE_OK;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue