Re: [PATCH v7 1/3] tests: Adjust the configuration for Apache 2.2
- From
Lars Schneider <larsxschneider@gmail.com>
- Date
- May 10, 2016, 06:37 UTC
- Message-ID
- <C5C883AD-E684-4D2F-811B-A479DE5E41AB@gmail.com>
- In-Reply-To
- <4a15c4e6c35cfb425da568d87e8b20b984e5325c.1462774709.git.johannes.schindelin@gmx.de>
Show 9 quoted lines
> On 09 May 2016, at 08:18, Johannes Schindelin <johannes.schindelin@gmx.de> wrote: > > Lars Schneider noticed that the configuration introduced to test the extra > HTTP headers cannot be used with Apache 2.2 (which is still actively > maintained, as pointed out by Junio Hamano). > > To let the tests pass with Apache 2.2 again, let's substitute the > offending <RequireAll> and `expr` by using old school RewriteCond > statements.
All Apache 2.2 tests run nicely on Travis CI with Ubuntu and OSX using this patch series: https://travis-ci.org/larsxschneider/git/builds/128955548
Thanks, Lars
Show 40 quoted lines
>
> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
> ---
> t/lib-httpd/apache.conf | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/t/lib-httpd/apache.conf b/t/lib-httpd/apache.conf
> index b8ed96f..29b34bb 100644
> --- a/t/lib-httpd/apache.conf
> +++ b/t/lib-httpd/apache.conf
> @@ -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,14 @@ 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 unfortunately lacks "not equal" matching, we use this
> +# ugly trick to fail *unless* the two headers are present.
> +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
>
> --
> 2.8.2.463.g99156ee
>
>