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/SearchView.pm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'lib/PublicInbox/SearchView.pm') diff --git a/lib/PublicInbox/SearchView.pm b/lib/PublicInbox/SearchView.pm index 8f61b4f4..746cb838 100644 --- a/lib/PublicInbox/SearchView.pm +++ b/lib/PublicInbox/SearchView.pm @@ -35,7 +35,7 @@ sub sres_top_html { my $res = html_start($q, $ctx) . '
';
 	if ($err) {
 		$code = 400;
-		$res .= err_txt($err) . "

" . foot($ctx);
+		$res .= err_txt($ctx, $err) . "

" . foot($ctx);
 	} elsif ($total == 0) {
 		$code = 404;
 		$res .= "\n\n[No results found]

".foot($ctx);
@@ -80,8 +80,9 @@ sub dump_mset {
 }
 
 sub err_txt {
-	my ($err) = @_;
-	my $u = 'http://xapian.org/docs/queryparser.html';
+	my ($ctx, $err) = @_;
+	my $u = '//xapian.org/docs/queryparser.html';
+	$u = PublicInbox::Hval::prurl($ctx->{cgi}->{env}, $u);
 	$err =~ s/^\s*Exception:\s*//; # bad word to show users :P
 	$err = PublicInbox::Hval->new_oneline($err)->as_html;
 	"\n\nBad query: $err\n" .
-- 
cgit v1.2.3-24-ge0c7