summaryrefslogtreecommitdiffhomepage
path: root/test/perl/input_copy/psgi.pl
diff options
context:
space:
mode:
Diffstat (limited to 'test/perl/input_copy/psgi.pl')
-rw-r--r--test/perl/input_copy/psgi.pl10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/perl/input_copy/psgi.pl b/test/perl/input_copy/psgi.pl
new file mode 100644
index 00000000..449e4027
--- /dev/null
+++ b/test/perl/input_copy/psgi.pl
@@ -0,0 +1,10 @@
+my $app = sub {
+ my ($environ) = @_;
+
+ open(my $fh, ">&", $environ->{'psgi.input'});
+
+ my $len = int($environ->{'CONTENT_LENGTH'});
+ $fh->read(my $body, $len);
+
+ return ['200', ['Content-Length' => $len], [$body]];
+};