diff options
author | Eric Wong <e@80x24.org> | 2016-02-25 03:10:50 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2016-02-25 04:03:02 +0000 |
commit | 8968889e3ebfa09dd2c80fe8b917b83ac13ff356 (patch) | |
tree | d7d27284f53eb7b0dc11ed5ee2c64ba1ec1ed738 /lib/PublicInbox/ExtMsg.pm | |
parent | 62a77b55c9fadec1b4b1ba061e99f4a18d8a14bc (diff) | |
download | public-inbox-8968889e3ebfa09dd2c80fe8b917b83ac13ff356.tar.gz |
Relying on Plack::Handler::CGI is much easier for long-term maintenance and development. Nowadays, we even include our own httpd implementation to facilitate easier deployment with PSGI/Plack.
Diffstat (limited to 'lib/PublicInbox/ExtMsg.pm')
-rw-r--r-- | lib/PublicInbox/ExtMsg.pm | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/PublicInbox/ExtMsg.pm b/lib/PublicInbox/ExtMsg.pm index d89a7e30..cf9b6d58 100644 --- a/lib/PublicInbox/ExtMsg.pm +++ b/lib/PublicInbox/ExtMsg.pm @@ -86,15 +86,7 @@ sub ext_msg { eval { require PublicInbox::Msgmap }; my $have_mm = $@ ? 0 : 1; my $cgi = $ctx->{cgi}; - my $base_url; - my $scheme; - if (ref($cgi) eq 'CGI') { - $base_url = $cgi->url(-base) . '/'; - $scheme = $cgi->protocol; - } else { # Plack::Request - $base_url = $cgi->base->as_string; - $scheme = $cgi->env->{'psgi.url_scheme'}; - } + my $base_url = $cgi->base->as_string; if ($have_mm) { my $tmp_mid = $mid; my $url; @@ -145,6 +137,7 @@ again: if (@EXT_URL && index($mid, '@') >= 0) { $code = 300; $s .= "\nPerhaps try an external site:\n\n"; + my $scheme = $cgi->scheme; foreach my $u (@EXT_URL) { $u = "$scheme:$u" if $u =~ m!\A//!; my $r = sprintf($u, $href); |