xref: /unit/test/perl/input_copy/psgi.pl (revision 544:c4bbb14c5bdb)
1*544Szelenkov@nginx.commy $app = sub {
2*544Szelenkov@nginx.com    my ($environ) = @_;
3*544Szelenkov@nginx.com
4*544Szelenkov@nginx.com    open(my $fh, ">&", $environ->{'psgi.input'});
5*544Szelenkov@nginx.com
6*544Szelenkov@nginx.com    my $len = int($environ->{'CONTENT_LENGTH'});
7*544Szelenkov@nginx.com    $fh->read(my $body, $len);
8*544Szelenkov@nginx.com
9*544Szelenkov@nginx.com    return ['200', ['Content-Length' => $len], [$body]];
10*544Szelenkov@nginx.com};
11