summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2010-11-29 17:52:30 -0800
committerJunio C Hamano <gitster@pobox.com>2010-11-29 17:52:30 -0800
commitfeedaf43dbf31b18d96c4116e3b3f0c522b2cd7b (patch)
tree5a5ac2a0e62c792d585bc95cbaabc37efb330181 /t
parent3fe9db3fef5434ca91e676b8f700d60e0b759496 (diff)
parent311e2ea0062bf09d6f78f5458eeb14dbc6c092ea (diff)
downloadgit-feedaf43dbf31b18d96c4116e3b3f0c522b2cd7b.tar.gz
Merge branch 'tc/smart-http-post-redirect'
* tc/smart-http-post-redirect: smart-http: Don't change POST to GET when following redirect
Diffstat (limited to 't')
-rw-r--r--t/lib-httpd/apache.conf7
-rwxr-xr-xt/t5551-http-fetch.sh8
2 files changed, 15 insertions, 0 deletions
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 4961505d1d..f41c7c674c 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -17,6 +17,9 @@ ErrorLog error.log
<IfModule !mod_env.c>
LoadModule env_module modules/mod_env.so
</IfModule>
+<IfModule !mod_rewrite.c>
+ LoadModule rewrite_module modules/mod_rewrite.so
+</IFModule>
Alias /dumb/ www/
@@ -36,6 +39,10 @@ ScriptAlias /smart_noexport/ ${GIT_EXEC_PATH}/git-http-backend/
Options ExecCGI
</Files>
+RewriteEngine on
+RewriteRule ^/smart-redir-perm/(.*)$ /smart/$1 [R=301]
+RewriteRule ^/smart-redir-temp/(.*)$ /smart/$1 [R=302]
+
<IfDefine SSL>
LoadModule ssl_module modules/mod_ssl.so
diff --git a/t/t5551-http-fetch.sh b/t/t5551-http-fetch.sh
index fd19121372..26d355725f 100755
--- a/t/t5551-http-fetch.sh
+++ b/t/t5551-http-fetch.sh
@@ -101,5 +101,13 @@ test_expect_success 'used upload-pack service' '
test_cmp exp act
'
+test_expect_success 'follow redirects (301)' '
+ git clone $HTTPD_URL/smart-redir-perm/repo.git --quiet repo-p
+'
+
+test_expect_success 'follow redirects (302)' '
+ git clone $HTTPD_URL/smart-redir-temp/repo.git --quiet repo-t
+'
+
stop_httpd
test_done