summaryrefslogtreecommitdiff
path: root/t/lib-httpd/apache.conf
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2017-03-10 13:24:23 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2017-03-10 13:24:23 -0800
commitd0f549f403266c14acc687098ee3e697a67984c2 (patch)
treece24b9ce27a85921cab6879dfa1956066fe9ce0d /t/lib-httpd/apache.conf
parentMerge branch 'jk/http-auth' (diff)
parenthttp: attempt updating base URL only if no error (diff)
downloadtgif-d0f549f403266c14acc687098ee3e697a67984c2.tar.xz
Merge branch 'jt/http-base-url-update-upon-redirect'
When a redirected http transport gets an error during the redirected request, we ignored the error we got from the server, and ended up giving a not-so-useful error message. * jt/http-base-url-update-upon-redirect: http: attempt updating base URL only if no error
Diffstat (limited to 't/lib-httpd/apache.conf')
-rw-r--r--t/lib-httpd/apache.conf9
1 files changed, 9 insertions, 0 deletions
diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
index 69174c6e31..0642ae7e6e 100644
--- a/t/lib-httpd/apache.conf
+++ b/t/lib-httpd/apache.conf
@@ -133,6 +133,15 @@ RewriteRule ^/ftp-redir/(.*)$ ftp://localhost:1000/$1 [R=302]
RewriteRule ^/loop-redir/x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-x-(.*) /$1 [R=302]
RewriteRule ^/loop-redir/(.*)$ /loop-redir/x-$1 [R=302]
+# redir-to/502/x?y -> really-redir-to?path=502/x&qs=y which returns 502
+# redir-to/x?y -> really-redir-to?path=x&qs=y -> x?y
+RewriteCond %{QUERY_STRING} ^(.*)$
+RewriteRule ^/redir-to/(.*)$ /really-redir-to?path=$1&qs=%1 [R=302]
+RewriteCond %{QUERY_STRING} ^path=502/(.*)&qs=(.*)$
+RewriteRule ^/really-redir-to$ - [R=502,L]
+RewriteCond %{QUERY_STRING} ^path=(.*)&qs=(.*)$
+RewriteRule ^/really-redir-to$ /%1?%2 [R=302]
+
# The first rule issues a client-side redirect to something
# that _doesn't_ look like a git repo. The second rule is a
# server-side rewrite, so that it turns out the odd-looking