From: Andreas Scherbaum Date: Wed, 15 Aug 2018 07:59:28 +0000 (+0200) Subject: Rewrite urls to https X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.%3Cscript%20data-cfasync=?a=commitdiff_plain;h=refs%2Fheads%2Fv2;p=docbot.git Rewrite urls to https --- diff --git a/docbot.pl b/docbot.pl index 816b95e..0c889b2 100755 --- a/docbot.pl +++ b/docbot.pl @@ -3773,12 +3773,12 @@ sub handle_command_learn { if ($keyword =~ /^$url_pattern/) { $url = $keyword; # rewrite to current - if ($url =~ /^(http:\/\/.*?postgresql\.org\/docs\/)[0-9\.]+(\/.*)$/i) { - $url = $1 . "current" . $2; + if ($url =~ /^https?:\/\/(.*?postgresql\.org\/docs\/)[0-9\.]+(\/.*)$/i) { + $url = 'https://' . $1 . "current" . $2; } # rewrite to static - if ($url =~ /^(http:\/\/\/\/.*?postgresql\.org\/docs\/current\/)interactive(\/.*)$/i) { - $url = $1 . "static" . $2; + if ($url =~ /^https?:\/\/(.*?postgresql\.org\/docs\/current\/)interactive(\/.*)$/i) { + $url = 'https://' . $1 . "static" . $2; } last; }