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