curl: fix the -w urle.* variables

urle.scheme, urle.user, urle.password and urle.options mistakenly
operated on the original URL instead of the *effective* (last) URL.

Add test 474 to verify.

Reported-by: Gruber Glass
Fixes #14550
Closes #14560
This commit is contained in:
Daniel Stenberg 2024-08-15 11:43:59 +02:00
parent 2401ee68a4
commit 5603204448
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 58 additions and 5 deletions

View file

@ -200,7 +200,7 @@ static int urlpart(struct per_transfer *per, writeoutid vid,
char *part = NULL;
const char *url = NULL;
if(vid >= VAR_INPUT_URLEHOST) {
if(vid >= VAR_INPUT_URLESCHEME) {
if(curl_easy_getinfo(per->curl, CURLINFO_EFFECTIVE_URL, &url))
rc = 5;
}