aboutsummaryrefslogtreecommitdiff
path: root/t/lib-httpd
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2012-10-31 07:29:16 -0400
committerJeff King <peff@peff.net>2012-10-31 07:45:13 -0400
commit2e736fd5e94c6fa44ba95d81a5b0ae407b968b78 (patch)
tree8a3808b42b50592d9c3eccc05865d3d4c3ba6b48 /t/lib-httpd
parentdf126e108b899da133a980e900df39dfe57fcd59 (diff)
downloadgit-2e736fd5e94c6fa44ba95d81a5b0ae407b968b78.tar.gz
git-2e736fd5e94c6fa44ba95d81a5b0ae407b968b78.tar.xz
remote-curl: retry failed requests for auth even with gzip
Commit b81401c taught the post_rpc function to retry the http request after prompting for credentials. However, it did not handle two cases: 1. If we have a large request, we do not retry. That's OK, since we would have sent a probe (with retry) already. 2. If we are gzipping the request, we do not retry. That was considered OK, because the intended use was for push (e.g., listing refs is OK, but actually pushing objects is not), and we never gzip on push. This patch teaches post_rpc to retry even a gzipped request. This has two advantages: 1. It is possible to configure a "half-auth" state for fetching, where the set of refs and their sha1s are advertised, but one cannot actually fetch objects. This is not a recommended configuration, as it leaks some information about what is in the repository (e.g., an attacker can try brute-forcing possible content in your repository and checking whether it matches your branch sha1). However, it can be slightly more convenient, since a no-op fetch will not require a password at all. 2. It future-proofs us should we decide to ever gzip more requests. Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 't/lib-httpd')
-rw-r--r--t/lib-httpd/apache.conf7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index ec8618dfd..15a3c7155 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -96,6 +96,13 @@ SSLEngine On
Require valid-user
</LocationMatch>
+<LocationMatch "^/auth-fetch/.*/git-upload-pack$">
+ AuthType Basic
+ AuthName "git-auth"
+ AuthUserFile passwd
+ Require valid-user
+</LocationMatch>
+
<IfDefine DAV>
LoadModule dav_module modules/mod_dav.so
LoadModule dav_fs_module modules/mod_dav_fs.so