Merge branch 'ew/fast-import-unpack-limit'
[gitweb.git] / t / lib-httpd / apache.conf
index b8ed96fac6e2e8a371b7caf8716b671585022382..018a83a5a18431f120672b7cd8874bfb72e8d8fb 100644 (file)
@@ -103,10 +103,6 @@ Alias /auth/dumb/ www/auth/dumb/
        Header set Set-Cookie name=value
 </LocationMatch>
 <LocationMatch /smart_headers/>
-       <RequireAll>
-               Require expr %{HTTP:x-magic-one} == 'abra'
-               Require expr %{HTTP:x-magic-two} == 'cadabra'
-       </RequireAll>
        SetEnv GIT_EXEC_PATH ${GIT_EXEC_PATH}
        SetEnv GIT_HTTP_EXPORT_ALL
 </LocationMatch>
@@ -136,6 +132,18 @@ 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]
 
+# Apache 2.2 does not understand <RequireAll>, so we use RewriteCond.
+# And as RewriteCond does not allow testing for non-matches, we match
+# the desired case first (one has abra, two has cadabra), and let it
+# pass by marking the RewriteRule as [L], "last rule, do not process
+# any other matching RewriteRules after this"), and then have another
+# RewriteRule that matches all other cases and lets them fail via '[F]',
+# "fail the request".
+RewriteCond %{HTTP:x-magic-one} =abra
+RewriteCond %{HTTP:x-magic-two} =cadabra
+RewriteRule ^/smart_headers/.* - [L]
+RewriteRule ^/smart_headers/.* - [F]
+
 <IfDefine SSL>
 LoadModule ssl_module modules/mod_ssl.so