]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/ExtMsg.pm
hval: implement common UI for protocol-relative URLs
[public-inbox.git] / lib / PublicInbox / ExtMsg.pm
index cf9b6d58ba8d3b9836300a28cf96cf2000c1fa8f..c6fc565a0eef6c22c4bf855d64e33485f9531724 100644 (file)
@@ -137,9 +137,9 @@ again:
        if (@EXT_URL && index($mid, '@') >= 0) {
                $code = 300;
                $s .= "\nPerhaps try an external site:\n\n";
-               my $scheme = $cgi->scheme;
+               my $env = $cgi->{env};
                foreach my $u (@EXT_URL) {
-                       $u = "$scheme:$u" if $u =~ m!\A//!;
+                       $u = PublicInbox::Hval::prurl($env, $u);
                        my $r = sprintf($u, $href);
                        my $t = sprintf($u, $html);
                        $s .= qq{<a\nhref="$r">$t</a>\n};