From 57cbe47ad5e935f5071e37b07c0a2bdcc91beea0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 25 Feb 2016 03:57:16 +0000 Subject: hval: implement common UI for protocol-relative URLs 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. --- lib/PublicInbox/Hval.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/PublicInbox/Hval.pm') 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; -- cgit v1.2.3-24-ge0c7