aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/pods.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/middlewares/pods.ts')
-rw-r--r--server/middlewares/pods.ts9
1 files changed, 6 insertions, 3 deletions
diff --git a/server/middlewares/pods.ts b/server/middlewares/pods.ts
index c255be899..eaf9aa144 100644
--- a/server/middlewares/pods.ts
+++ b/server/middlewares/pods.ts
@@ -1,6 +1,9 @@
1import 'express-validator'
2import * as express from 'express'
3
1import { REMOTE_SCHEME } from '../initializers' 4import { REMOTE_SCHEME } from '../initializers'
2 5
3function setBodyHostsPort (req, res, next) { 6function setBodyHostsPort (req: express.Request, res: express.Response, next: express.NextFunction) {
4 if (!req.body.hosts) return next() 7 if (!req.body.hosts) return next()
5 8
6 for (let i = 0; i < req.body.hosts.length; i++) { 9 for (let i = 0; i < req.body.hosts.length; i++) {
@@ -17,7 +20,7 @@ function setBodyHostsPort (req, res, next) {
17 return next() 20 return next()
18} 21}
19 22
20function setBodyHostPort (req, res, next) { 23function setBodyHostPort (req: express.Request, res: express.Response, next: express.NextFunction) {
21 if (!req.body.host) return next() 24 if (!req.body.host) return next()
22 25
23 const hostWithPort = getHostWithPort(req.body.host) 26 const hostWithPort = getHostWithPort(req.body.host)
@@ -41,7 +44,7 @@ export {
41 44
42// --------------------------------------------------------------------------- 45// ---------------------------------------------------------------------------
43 46
44function getHostWithPort (host) { 47function getHostWithPort (host: string) {
45 const splitted = host.split(':') 48 const splitted = host.split(':')
46 49
47 // The port was not specified 50 // The port was not specified