From bd67d9f4acfbb4f8bd373006f77102126df8eeba Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Wed, 9 Mar 2022 17:18:44 -0500 Subject: [core] permit env w/ blank value (fix regression) (thx Lars Bingchong) empty env var must be set to blank string and not left unset (regression in lighttpd 1.4.56 - lighttpd 1.4.64) x-ref: https://stackoverflow.com/a/52913064/1338888 --- tests/request.t | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) (limited to 'tests/request.t') diff --git a/tests/request.t b/tests/request.t index 5c27c48b..68829d5b 100755 --- a/tests/request.t +++ b/tests/request.t @@ -8,7 +8,7 @@ BEGIN { use strict; use IO::Socket; -use Test::More tests => 176; +use Test::More tests => 178; use LightyTest; my $tf = LightyTest->new(); @@ -1399,6 +1399,24 @@ EOF $t->{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, '+Content-Length' => '' } ]; ok($tf->handle_http($t) == 0, 'cgi-env: HTTP_HOST'); +$t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '[ABSENT not found]' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: ABSENT'); + +$t->{REQUEST} = ( <{RESPONSE} = [ { 'HTTP-Protocol' => 'HTTP/1.1', 'HTTP-Status' => 200, 'HTTP-Content' => '' } ]; +ok($tf->handle_http($t) == 0, 'cgi-env: BLANK_VALUE'); + # broken header crash $t->{REQUEST} = ( <