From: Chocobozzz Date: Mon, 30 Dec 2019 09:44:50 +0000 (+0100) Subject: Fix URL normalization in import script X-Git-Tag: v2.1.0-rc.1~131 X-Git-Url: https://git.immae.eu/?a=commitdiff_plain;h=4449d2695bad78ac149ef5615f50286dcbe06f04;p=github%2FChocobozzz%2FPeerTube.git Fix URL normalization in import script --- diff --git a/server/tools/peertube-import-videos.ts b/server/tools/peertube-import-videos.ts index 39e8221c0..eaa792763 100644 --- a/server/tools/peertube-import-videos.ts +++ b/server/tools/peertube-import-videos.ts @@ -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 }