X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fhelpers%2Fcustom-validators%2Fpods.js;h=0154a242432b1bf43b6bc35ab94bb105864f82e8;hb=49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed;hp=40f8b5d0b895f4ad8819a0625f14c3727d98113d;hpb=41b5da1d8cb41f5c49f0e0a01a54106c9a5925dd;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/helpers/custom-validators/pods.js b/server/helpers/custom-validators/pods.js index 40f8b5d0b..0154a2424 100644 --- a/server/helpers/custom-validators/pods.js +++ b/server/helpers/custom-validators/pods.js @@ -5,14 +5,14 @@ const validator = require('express-validator').validator const miscValidators = require('./misc') const podsValidators = { - isEachUniqueUrlValid + isEachUniqueHostValid } -function isEachUniqueUrlValid (urls) { - return miscValidators.isArray(urls) && - urls.length !== 0 && - urls.every(function (url) { - return validator.isURL(url) && urls.indexOf(url) === urls.lastIndexOf(url) +function isEachUniqueHostValid (hosts) { + return miscValidators.isArray(hosts) && + hosts.length !== 0 && + hosts.every(function (host) { + return validator.isURL(host) && host.split('://').length === 1 && hosts.indexOf(host) === hosts.lastIndexOf(host) }) }