diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-01-01 23:41:21 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-01-02 23:40:47 +0100 |
commit | 648712eec1eedb05965b9b4d6dd457bda5d70481 (patch) | |
tree | e696618bd90aa6ccbc743f88b72e760045fc8c56 /lib/url.c | |
parent | 725ec470e2ca5b1eb01ffee84d432653a8070722 (diff) | |
download | curl-648712eec1eedb05965b9b4d6dd457bda5d70481.tar.gz |
httpauth: make multi-request auth work with custom port
When doing HTTP authentication and a port number set with CURLOPT_PORT,
the code would previously have the URL's port number override as if it
had been a redirect to an absolute URL.
Added test 1568 to verify.
Reported-by: UrsusArctos on github
Fixes #6397
Closes #6400
Diffstat (limited to 'lib/url.c')
-rw-r--r-- | lib/url.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -2003,7 +2003,9 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data, } else { unsigned long port = strtoul(data->state.up.port, NULL, 10); - conn->port = conn->remote_port = curlx_ultous(port); + conn->port = conn->remote_port = + (data->set.use_port && data->state.allow_port) ? + (int)data->set.use_port : curlx_ultous(port); } (void)curl_url_get(uh, CURLUPART_QUERY, &data->state.up.query, 0); |