]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
Fix URL normalization in import script
authorChocobozzz <me@florianbigard.com>
Mon, 30 Dec 2019 09:44:50 +0000 (10:44 +0100)
committerChocobozzz <me@florianbigard.com>
Mon, 30 Dec 2019 09:44:50 +0000 (10:44 +0100)
server/tools/peertube-import-videos.ts

index 39e8221c0c23a961de7ad736e1d6d1a9ccc59b3f..eaa792763a6580beffc2db58a3ab77f46d4f3137 100644 (file)
@@ -333,7 +333,7 @@ function isNSFW (info: any) {
 function normalizeTargetUrl (url: string) {
   let normalizedUrl = url.replace(/\/+$/, '')
 
-  if (!normalizedUrl.startsWith('http://') || !normalizedUrl.startsWith('https://')) {
+  if (!normalizedUrl.startsWith('http://') && !normalizedUrl.startsWith('https://')) {
     normalizedUrl = 'https://' + normalizedUrl
   }