diff options
Diffstat (limited to 'server/middlewares/pods.ts')
-rw-r--r-- | server/middlewares/pods.ts | 9 |
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 @@ | |||
1 | import 'express-validator' | ||
2 | import * as express from 'express' | ||
3 | |||
1 | import { REMOTE_SCHEME } from '../initializers' | 4 | import { REMOTE_SCHEME } from '../initializers' |
2 | 5 | ||
3 | function setBodyHostsPort (req, res, next) { | 6 | function 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 | ||
20 | function setBodyHostPort (req, res, next) { | 23 | function 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 | ||
44 | function getHostWithPort (host) { | 47 | function 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 |