mirror of
https://github.com/curl/curl.git
synced 2026-07-23 23:47:15 +03:00
http: fix HTTP auth to include query in URI
- Include query in the path passed to generate HTTP auth.
Recent changes to use the URL API internally (46e1640, 7.62.0)
inadvertently broke authentication URIs by omitting the query.
Fixes https://github.com/curl/curl/issues/3353
Closes #3356
This commit is contained in:
parent
c8bf8cc1e4
commit
552f0205e6
3 changed files with 89 additions and 5 deletions
17
lib/http.c
17
lib/http.c
|
|
@ -702,7 +702,7 @@ output_auth_headers(struct connectdata *conn,
|
|||
*
|
||||
* @param conn all information about the current connection
|
||||
* @param request pointer to the request keyword
|
||||
* @param path pointer to the requested path
|
||||
* @param path pointer to the requested path; should include query part
|
||||
* @param proxytunnel boolean if this is the request setting up a "proxy
|
||||
* tunnel"
|
||||
*
|
||||
|
|
@ -2000,9 +2000,18 @@ CURLcode Curl_http(struct connectdata *conn, bool *done)
|
|||
}
|
||||
|
||||
/* setup the authentication headers */
|
||||
result = Curl_http_output_auth(conn, request, path, FALSE);
|
||||
if(result)
|
||||
return result;
|
||||
{
|
||||
char *pq = NULL;
|
||||
if(query && *query) {
|
||||
pq = aprintf("%s?%s", path, query);
|
||||
if(!pq)
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
result = Curl_http_output_auth(conn, request, (pq ? pq : path), FALSE);
|
||||
free(pq);
|
||||
if(result)
|
||||
return result;
|
||||
}
|
||||
|
||||
if((data->state.authhost.multipass || data->state.authproxy.multipass) &&
|
||||
(httpreq != HTTPREQ_GET) &&
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue