From: Graham Knop Date: Sun, 26 Jul 2020 19:10:51 +0000 (+0200) Subject: configure lighttpd at root correctly in tests X-Git-Tag: v5.90_127~5 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=e91462552b2ba10034c82a4c981fe63dfeb57a6e;hp=eebd1520470f767fdefdc03c1fe05427e5f182f9 configure lighttpd at root correctly in tests Catalyst only works around lighttpd weirdness when using old versions. On new versions, it expects to be configured correctly to avoid the buggy behavior. Fix the test to provide the correct configuration on lighttpd versions that support it. --- diff --git a/t/optional_lighttpd-fastcgi.t b/t/optional_lighttpd-fastcgi.t index 1d3ca40..74e768d 100644 --- a/t/optional_lighttpd-fastcgi.t +++ b/t/optional_lighttpd-fastcgi.t @@ -32,6 +32,13 @@ chomp $lighttpd_bin; plan skip_all => 'Please set LIGHTTPD_BIN to the path to lighttpd' unless $lighttpd_bin && -x $lighttpd_bin; +my $fix_scriptname = ''; +if (my ($vmajor, $vminor, $vpatch) = `"$lighttpd_bin" -v` =~ /\b(\d+)\.(\d+)\.(\d+)\b/) { + if ($vmajor > 1 || ($vmajor == 1 && ("$vminor.$vpatch" >= 4.23))) { + $fix_scriptname = '"fix-root-scriptname" => "enable",'; + } +} + plan tests => 1; # this creates t/tmp/TestApp @@ -64,7 +71,7 @@ server.port = $port # catalyst app specific fcgi setup fastcgi.server = ( - "" => ( + "/" => ( "FastCgiTest" => ( "socket" => "$docroot/test.socket", "check-local" => "disable", @@ -72,6 +79,7 @@ fastcgi.server = ( "min-procs" => 1, "max-procs" => 1, "idle-timeout" => 20, + $fix_scriptname "bin-environment" => ( "PERL5LIB" => "$perl5lib" )