summaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-03-30 21:35:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-03-30 21:35:37 (GMT)
commit501380286295cac300dae86c3f0f6c10ff34b767 (patch)
treee4bf7b3eeb49de3feceeea106cc3820d4c22f3b9 /http.c
parentb2309ad822500ba2c1088800b369851fad261e77 (diff)
parent1b0d9545bb85912a16b367229d414f55d140d3be (diff)
downloadgit-501380286295cac300dae86c3f0f6c10ff34b767.zip
git-501380286295cac300dae86c3f0f6c10ff34b767.tar.gz
git-501380286295cac300dae86c3f0f6c10ff34b767.tar.bz2
Merge branch 'cs/http-use-basic-after-failed-negotiate'
When accessing a server with a URL like https://user:pass@site/, we did not to fall back to the basic authentication with the credential material embedded in the URL after the "Negotiate" authentication failed. Now we do. * cs/http-use-basic-after-failed-negotiate: remote-curl: fall back to basic auth if Negotiate fails
Diffstat (limited to 'http.c')
-rw-r--r--http.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/http.c b/http.c
index 70b0f15..406410f 100644
--- a/http.c
+++ b/http.c
@@ -1650,17 +1650,18 @@ static int handle_curl_result(struct slot_results *results)
} else if (missing_target(results))
return HTTP_MISSING_TARGET;
else if (results->http_code == 401) {
+#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
+ http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
+ if (results->auth_avail) {
+ http_auth_methods &= results->auth_avail;
+ http_auth_methods_restricted = 1;
+ return HTTP_REAUTH;
+ }
+#endif
if (http_auth.username && http_auth.password) {
credential_reject(&http_auth);
return HTTP_NOAUTH;
} else {
-#ifdef LIBCURL_CAN_HANDLE_AUTH_ANY
- http_auth_methods &= ~CURLAUTH_GSSNEGOTIATE;
- if (results->auth_avail) {
- http_auth_methods &= results->auth_avail;
- http_auth_methods_restricted = 1;
- }
-#endif
return HTTP_REAUTH;
}
} else {