aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/servers.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/servers.ts')
-rw-r--r--server/middlewares/servers.ts18
1 files changed, 1 insertions, 17 deletions
diff --git a/server/middlewares/servers.ts b/server/middlewares/servers.ts
index eaf9aa144..488f9c368 100644
--- a/server/middlewares/servers.ts
+++ b/server/middlewares/servers.ts
@@ -20,26 +20,10 @@ function setBodyHostsPort (req: express.Request, res: express.Response, next: ex
20 return next() 20 return next()
21} 21}
22 22
23function setBodyHostPort (req: express.Request, res: express.Response, next: express.NextFunction) {
24 if (!req.body.host) return next()
25
26 const hostWithPort = getHostWithPort(req.body.host)
27
28 // Problem with the url parsing?
29 if (hostWithPort === null) {
30 return res.sendStatus(500)
31 }
32
33 req.body.host = hostWithPort
34
35 return next()
36}
37
38// --------------------------------------------------------------------------- 23// ---------------------------------------------------------------------------
39 24
40export { 25export {
41 setBodyHostsPort, 26 setBodyHostsPort
42 setBodyHostPort
43} 27}
44 28
45// --------------------------------------------------------------------------- 29// ---------------------------------------------------------------------------