about summary refs log tree commit homepage
path: root/lib/PublicInbox/Hval.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-25 03:57:16 +0000
committerEric Wong <e@80x24.org>2016-02-25 04:03:06 +0000
commit57cbe47ad5e935f5071e37b07c0a2bdcc91beea0 (patch)
treee0436793ba19d2409e1ad9e9baffe8a7dd7b10c4 /lib/PublicInbox/Hval.pm
parent65ff86f333a1f8276943248efef7fa2a64afe9e3 (diff)
downloadpublic-inbox-57cbe47ad5e935f5071e37b07c0a2bdcc91beea0.tar.gz
This allows users to avoid HTTPS -> HTTP downgrade warnings,
but we will also avoid encouraging them towards HTTPS, for now.

IMHO: the CA system gives a false sense of security,
TLS libraries (e.g. OpenSSL) can introduce new bugs and
problems (even to attack clients), and TLS libraries
also eats memory on cheap servers.
Diffstat (limited to 'lib/PublicInbox/Hval.pm')
-rw-r--r--lib/PublicInbox/Hval.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/Hval.pm b/lib/PublicInbox/Hval.pm
index d295f5ce..a455884f 100644
--- a/lib/PublicInbox/Hval.pm
+++ b/lib/PublicInbox/Hval.pm
@@ -69,4 +69,9 @@ sub raw {
         }
 }
 
+sub prurl {
+        my ($env, $u) = @_;
+        index($u, '//') == 0 ? "$env->{'psgi.url_scheme'}:$u" : $u;
+}
+
 1;