-import 'express-validator'
import * as express from 'express'
-import { getHostWithPort } from '../helpers'
-
-import { REMOTE_SCHEME } from '../initializers'
+import { getHostWithPort } from '../helpers/express-utils'
+import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
function setBodyHostsPort (req: express.Request, res: express.Response, next: express.NextFunction) {
if (!req.body.hosts) return next()
// Problem with the url parsing?
if (hostWithPort === null) {
- return res.sendStatus(500)
+ return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500)
}
req.body.hosts[i] = hostWithPort