From 2d53be0267acc49cda46707b885096193a1f4e9c Mon Sep 17 00:00:00 2001 From: Rigel Kent Date: Mon, 7 Dec 2020 14:32:36 +0100 Subject: replace numbers with typed http status codes (#3409) --- server/middlewares/servers.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/middlewares/servers.ts') diff --git a/server/middlewares/servers.ts b/server/middlewares/servers.ts index 9c0af443a..5e1c165f0 100644 --- a/server/middlewares/servers.ts +++ b/server/middlewares/servers.ts @@ -1,5 +1,6 @@ import * as express from 'express' 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() @@ -9,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 -- cgit v1.2.3