X-Git-Url: http://www.git.stargrave.org/?a=blobdiff_plain;f=lib%2FPublicInbox%2FHTTPD.pm;fp=lib%2FPublicInbox%2FHTTPD.pm;h=02f424c67138edca6af65835b1f2feb328d3a72d;hb=b5d21c2b21cc1c19b29d3298d14f207ba910a31d;hp=fb683f746a9c988875dd2ee0e141df8d23021d1c;hpb=5d3e9705c8d5a6d0341a5f1bed2027ef9f9e95a8;p=public-inbox.git diff --git a/lib/PublicInbox/HTTPD.pm b/lib/PublicInbox/HTTPD.pm index fb683f74..02f424c6 100644 --- a/lib/PublicInbox/HTTPD.pm +++ b/lib/PublicInbox/HTTPD.pm @@ -13,7 +13,7 @@ use PublicInbox::Daemon; sub pi_httpd_async { PublicInbox::HTTPD::Async->new(@_) } sub new { - my ($class, $sock, $app) = @_; + my ($class, $sock, $app, $client) = @_; my $n = getsockname($sock) or die "not a socket: $sock $!\n"; my ($host, $port) = PublicInbox::Daemon::host_with_port($n); @@ -23,7 +23,8 @@ sub new { SCRIPT_NAME => '', 'psgi.version' => [ 1, 1 ], 'psgi.errors' => \*STDERR, - 'psgi.url_scheme' => 'http', + 'psgi.url_scheme' => $client->can('accept_SSL') ? + 'https' : 'http', 'psgi.nonblocking' => Plack::Util::TRUE, 'psgi.streaming' => Plack::Util::TRUE, 'psgi.run_once' => Plack::Util::FALSE,