diff options
author | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
---|---|---|
committer | Chocobozzz <florian.bigard@gmail.com> | 2017-06-10 22:15:25 +0200 |
commit | 69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch) | |
tree | ad199a18ec3c322460d6f9523fc383ee562554e0 /server/middlewares/pods.ts | |
parent | 4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff) | |
download | PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.gz PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.tar.zst PeerTube-69818c9394366b954b6ba3bd697bd9d2b09f2a16.zip |
Type functions
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 |