diff options
author | Andrey Zelenkov <zelenkov@nginx.com> | 2018-02-12 19:32:54 +0300 |
---|---|---|
committer | Andrey Zelenkov <zelenkov@nginx.com> | 2018-02-12 19:32:54 +0300 |
commit | e2c3fa630469bf006de5a983910e391c5889430d (patch) | |
tree | 2021663f938438db7c18b3bcc87b6402b6d6b5e1 /test/perl/variables | |
parent | 9646772a00e50c437e0b3204ce6233b6414e1053 (diff) | |
download | unit-e2c3fa630469bf006de5a983910e391c5889430d.tar.gz unit-e2c3fa630469bf006de5a983910e391c5889430d.tar.bz2 |
Tests: perl module.
Diffstat (limited to 'test/perl/variables')
-rw-r--r-- | test/perl/variables/psgi.pl | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/test/perl/variables/psgi.pl b/test/perl/variables/psgi.pl new file mode 100644 index 00000000..c0a61b67 --- /dev/null +++ b/test/perl/variables/psgi.pl @@ -0,0 +1,16 @@ +my $app = sub { + my ($environ) = @_; + + my $len = int($environ->{'CONTENT_LENGTH'}); + $environ->{'psgi.input'}->read(my $body, $len); + + return ['200', [ + 'Content-Type' => $environ->{'CONTENT_TYPE'}, + 'Content-Length' => $len, + 'Request-Method' => $environ->{'REQUEST_METHOD'}, + 'Request-Uri' => $environ->{'REQUEST_URI'}, + 'Http-Host' => $environ->{'HTTP_HOST'}, + 'Server-Protocol' => $environ->{'SERVER_PROTOCOL'}, + 'Custom-Header' => $environ->{'HTTP_CUSTOM_HEADER'} + ], [$body]]; +}; |