+import 'express-validator'
+import * as express from 'express'
+
import { REMOTE_SCHEME } from '../initializers'
-function setBodyHostsPort (req, res, next) {
+function setBodyHostsPort (req: express.Request, res: express.Response, next: express.NextFunction) {
if (!req.body.hosts) return next()
for (let i = 0; i < req.body.hosts.length; i++) {
return next()
}
-function setBodyHostPort (req, res, next) {
+function setBodyHostPort (req: express.Request, res: express.Response, next: express.NextFunction) {
if (!req.body.host) return next()
const hostWithPort = getHostWithPort(req.body.host)
// ---------------------------------------------------------------------------
-function getHostWithPort (host) {
+function getHostWithPort (host: string) {
const splitted = host.split(':')
// The port was not specified