]> Sergey Matveev's repositories - public-inbox.git/blobdiff - t/httpd-corner.psgi
t/httpd-corner: additional callback test
[public-inbox.git] / t / httpd-corner.psgi
index 349b35dfb22d32df1096af54cba0f4001b19f7b0..da8a2ee8b646ef7b9937c9d72ab9616e924f4fd3 100644 (file)
@@ -47,6 +47,15 @@ my $app = sub {
        } elsif ($path eq '/host-port') {
                $code = 200;
                push @$body, "$env->{REMOTE_ADDR}:$env->{REMOTE_PORT}";
+       } elsif ($path eq '/callback') {
+               return sub {
+                       my ($res) = @_;
+                       my $buf = "hello world\n";
+                       push @$h, 'Content-Length', length($buf);
+                       my $fh = $res->([200, $h]);
+                       $fh->write($buf);
+                       $fh->close;
+               }
        }
 
        [ $code, $h, $body ]