X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fmiddlewares%2Fservers.ts;h=5e1c165f06d0a98bb1332ae43bf4e4cfcf3b381a;hb=cedbdbfeabf14f5d6cd9d91190f0eebdf774bd72;hp=c52f4685b94785b94f10e4e65aca0f5ff3fcfc22;hpb=0626e7af82e02f8a5bd1e74a7d4d8c916d073ceb;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/middlewares/servers.ts b/server/middlewares/servers.ts index c52f4685b..5e1c165f0 100644 --- a/server/middlewares/servers.ts +++ b/server/middlewares/servers.ts @@ -1,6 +1,6 @@ import * as express from 'express' -import 'express-validator' 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() @@ -10,7 +10,7 @@ function setBodyHostsPort (req: express.Request, res: express.Response, next: ex // 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