aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/pods.ts
diff options
context:
space:
mode:
authorChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
committerChocobozzz <florian.bigard@gmail.com>2017-06-10 22:15:25 +0200
commit69818c9394366b954b6ba3bd697bd9d2b09f2a16 (patch)
treead199a18ec3c322460d6f9523fc383ee562554e0 /server/middlewares/pods.ts
parent4d4e5cd4dca78480ec7f40e747f424cd107376a4 (diff)
downloadPeerTube-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.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