diff options
author | Glenn Strauss <gstrauss@gluelogic.com> | 2022-03-09 17:18:44 -0500 |
---|---|---|
committer | Glenn Strauss <gstrauss@gluelogic.com> | 2022-03-09 19:51:42 -0500 |
commit | bd67d9f4acfbb4f8bd373006f77102126df8eeba (patch) | |
tree | 51e3a14398cba32a867c4626a8f04ec852dbe00c /tests/request.t | |
parent | e447de1b66bde910a013f26dad52777f877feed7 (diff) | |
download | lighttpd-git-bd67d9f4acfbb4f8bd373006f77102126df8eeba.tar.gz |
[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
Diffstat (limited to 'tests/request.t')
-rwxr-xr-x | tests/request.t | 20 |
1 files changed, 19 insertions, 1 deletions
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} = ( <<EOF +GET /cgi.pl?env=ABSENT HTTP/1.1 +Host: www.example.org +Connection: close +EOF + ); +$t->{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} = ( <<EOF +GET /cgi.pl?env=BLANK_VALUE HTTP/1.1 +Host: www.example.org +Connection: close +EOF + ); +$t->{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} = ( <<EOF GET /cgi.pl?crlfcrash HTTP/1.0 |