http: custom Authorization: header overrides Negotiate

As documented and as it does for other methods.

Difficult to test since it needs a successful kerberos ticket.

Reported-by: sdgh179 on github
Fixes #22610
Closes #22622
This commit is contained in:
Daniel Stenberg 2026-08-19 09:32:16 +02:00
parent fc6c67ce86
commit 9b29495863
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2

View file

@ -687,10 +687,19 @@ static CURLcode output_auth_headers(struct Curl_easy *data,
#endif
#ifdef USE_SPNEGO
if(authstatus->picked == CURLAUTH_NEGOTIATE) {
auth = "Negotiate";
result = Curl_output_negotiate(data, conn, proxy);
if(result)
return result;
if(
#ifndef CURL_DISABLE_PROXY
(proxy && !Curl_checkProxyheaders(data, conn,
STRCONST("Proxy-authorization"))) ||
#endif
(!proxy && !Curl_checkheaders(data, STRCONST("Authorization")))) {
auth = "Negotiate";
result = Curl_output_negotiate(data, conn, proxy);
if(result)
return result;
}
else
authstatus->done = TRUE;
}
else
#endif