]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/middlewares/pods.js
Use yarn instead of npm install
[github/Chocobozzz/PeerTube.git] / server / middlewares / pods.js
index e38fb341d0fb61c31dccec046dc6a83c97cca285..2647f9ff0b342849007fbca19cfcb552b72ee339 100644 (file)
@@ -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?