aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/helpers/custom-validators/pods.js
diff options
context:
space:
mode:
Diffstat (limited to 'server/helpers/custom-validators/pods.js')
-rw-r--r--server/helpers/custom-validators/pods.js12
1 files changed, 6 insertions, 6 deletions
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
5const miscValidators = require('./misc') 5const miscValidators = require('./misc')
6 6
7const podsValidators = { 7const podsValidators = {
8 isEachUniqueUrlValid 8 isEachUniqueHostValid
9} 9}
10 10
11function isEachUniqueUrlValid (urls) { 11function isEachUniqueHostValid (hosts) {
12 return miscValidators.isArray(urls) && 12 return miscValidators.isArray(hosts) &&
13 urls.length !== 0 && 13 hosts.length !== 0 &&
14 urls.every(function (url) { 14 hosts.every(function (host) {
15 return validator.isURL(url) && urls.indexOf(url) === urls.lastIndexOf(url) 15 return validator.isURL(host) && host.split('://').length === 1 && hosts.indexOf(host) === hosts.lastIndexOf(host)
16 }) 16 })
17} 17}
18 18