summaryrefslogtreecommitdiff
path: root/credential.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2023-03-17 21:03:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2023-03-17 21:03:10 (GMT)
commit92c56da09683fa3331668adec073b6769da8f0b7 (patch)
treeb114e12cbf97692ce1e07af74616d8b38cda0408 /credential.c
parentaf5388d2ddb0bc7c22fbe698078f4ca07879d954 (diff)
parent5f2117b24f568ecc789c677748d70ccd538b16ba (diff)
downloadgit-92c56da09683fa3331668adec073b6769da8f0b7.zip
git-92c56da09683fa3331668adec073b6769da8f0b7.tar.gz
git-92c56da09683fa3331668adec073b6769da8f0b7.tar.bz2
Merge branch 'mc/credential-helper-www-authenticate'
Allow information carried on the WWW-AUthenticate header to be passed to the credential helpers. * mc/credential-helper-www-authenticate: credential: add WWW-Authenticate header to cred requests http: read HTTP WWW-Authenticate response headers t5563: add tests for basic and anoymous HTTP access
Diffstat (limited to 'credential.c')
-rw-r--r--credential.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/credential.c b/credential.c
index f320113..ea40a2a 100644
--- a/credential.c
+++ b/credential.c
@@ -23,6 +23,7 @@ void credential_clear(struct credential *c)
free(c->username);
free(c->password);
string_list_clear(&c->helpers, 0);
+ strvec_clear(&c->wwwauth_headers);
credential_init(c);
}
@@ -280,6 +281,8 @@ void credential_write(const struct credential *c, FILE *fp)
credential_write_item(fp, "password_expiry_utc", s, 0);
free(s);
}
+ for (size_t i = 0; i < c->wwwauth_headers.nr; i++)
+ credential_write_item(fp, "wwwauth[]", c->wwwauth_headers.v[i], 0);
}
static int run_credential_helper(struct credential *c,