1 # Copyright (C) 2016 all contributors <meta@public-inbox.org>
2 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
3 # corner case tests for the generic PSGI server
4 # Usage: plackup [OPTIONS] /path/to/this/file
12 my $path = $env->{PATH_INFO};
13 my $in = $env->{'psgi.input'};
16 my $h = [ 'Content-Type' => 'text/plain' ];
18 if ($path eq '/sha1') {
19 my $sha1 = Digest::SHA->new('SHA-1');
22 my $r = $in->read($buf, 4096);
23 die "read err: $!" unless defined $r;
28 push @$body, $sha1->hexdigest;
34 enable 'ContentLength';