X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fpods.js;h=2647f9ff0b342849007fbca19cfcb552b72ee339;hb=85cd99dc84cea7e9f428f251214bcdae428a9843;hp=487ea1259e6a403a149e5fb28a5a40d6671b9db5;hpb=49abbbbedca83b9031d3e2eb3ae9ad9b6a7d96ed;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/pods.js b/server/middlewares/pods.js index 487ea1259..2647f9ff0 100644 --- a/server/middlewares/pods.js +++ b/server/middlewares/pods.js @@ -8,6 +8,8 @@ const podsMiddleware = { } function setBodyHostsPort (req, res, next) { + if (!req.body.hosts) return next() + for (let i = 0; i < req.body.hosts.length; i++) { const hostWithPort = getHostWithPort(req.body.hosts[i]) @@ -23,6 +25,8 @@ function setBodyHostsPort (req, res, next) { } function setBodyHostPort (req, res, next) { + if (!req.body.host) return next() + const hostWithPort = getHostWithPort(req.body.host) // Problem with the url parsing? @@ -44,7 +48,6 @@ module.exports = podsMiddleware function getHostWithPort (host) { const splitted = host.split(':') - console.log(splitted) // The port was not specified if (splitted.length === 1) { if (constants.REMOTE_SCHEME.HTTP === 'https') return host + ':443'