Rewrite urls to https v2
authorAndreas Scherbaum <[email protected]>
Wed, 15 Aug 2018 07:59:28 +0000 (09:59 +0200)
committerAndreas Scherbaum <[email protected]>
Wed, 15 Aug 2018 07:59:28 +0000 (09:59 +0200)
docbot.pl

index 816b95e322f8e72ad64c9ca5f722aaac2c9be33a..0c889b27ce316d3fa544fdc138a91a3d6751d4b6 100755 (executable)
--- 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;
         }