aboutsummaryrefslogtreecommitdiffstats
path: root/http.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-05-21 05:48:25 +0900
committerJunio C Hamano <gitster@pobox.com>2021-05-21 05:49:41 +0900
commitc69f2f8c869361e9e2bdb9fb3ceb2fe058013744 (patch)
treeecdeae936d072a0fdf97986b156e41aa297f36dc /http.c
parent88dd4282d949cdafff516650c1be8aaf4d67983f (diff)
parentecf7b129fa8619bfe16c5f7e470717ad79186e07 (diff)
downloadgit-c69f2f8c869361e9e2bdb9fb3ceb2fe058013744.tar.gz
Merge branch 'cs/http-use-basic-after-failed-negotiate'
Regression fix for a change made during this cycle. * cs/http-use-basic-after-failed-negotiate: Revert "remote-curl: fall back to basic auth if Negotiate fails" t5551: test http interaction with credential helpers
Diffstat (limited to 'http.c')
-rw-r--r--http.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/http.c b/http.c
index c83bc33a5f..8119247149 100644
--- a/http.c
+++ b/http.c
@@ -1650,18 +1650,17 @@ 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 {