about summary refs log tree commit homepage
path: root/t/httpd-corner.psgi
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-03-03 05:14:31 +0000
committerEric Wong <e@80x24.org>2016-03-03 09:19:16 +0000
commitb38de6f02fa04e36b881d2aad9c7f792beb0b6a1 (patch)
treef0d6f21a534a7da7ac29a0a082921cf1d0566e14 /t/httpd-corner.psgi
parentb8e30717b529d6461190b54efa8c6402197cdd4e (diff)
downloadpublic-inbox-b38de6f02fa04e36b881d2aad9c7f792beb0b6a1.tar.gz
This allows us to share more code between daemons and avoids
having to make additional syscalls for preparing REMOTE_HOST
and REMOTE_PORT in the PSGI env in -httpd.

This will also make supporting HTTP (and NNTP) over Unix sockets
easier in a future commit.
Diffstat (limited to 't/httpd-corner.psgi')
-rw-r--r--t/httpd-corner.psgi3
1 files changed, 3 insertions, 0 deletions
diff --git a/t/httpd-corner.psgi b/t/httpd-corner.psgi
index c3bf5231..349b35df 100644
--- a/t/httpd-corner.psgi
+++ b/t/httpd-corner.psgi
@@ -44,6 +44,9 @@ my $app = sub {
                                 $fh->close;
                         };
                 }
+        } elsif ($path eq '/host-port') {
+                $code = 200;
+                push @$body, "$env->{REMOTE_ADDR}:$env->{REMOTE_PORT}";
         }
 
         [ $code, $h, $body ]