-function setBodyHostPort (req: express.Request, res: express.Response, next: express.NextFunction) {
- if (!req.body.host) return next()
-
- const hostWithPort = getHostWithPort(req.body.host)
-
- // Problem with the url parsing?
- if (hostWithPort === null) {
- return res.sendStatus(500)
- }
-
- req.body.host = hostWithPort
-
- return next()
-}
-