aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/servers.ts
diff options
context:
space:
mode:
authorRigel Kent <sendmemail@rigelk.eu>2020-12-07 14:32:36 +0100
committerGitHub <noreply@github.com>2020-12-07 14:32:36 +0100
commit2d53be0267acc49cda46707b885096193a1f4e9c (patch)
tree887061a34bc67f40acbb96a6278f9544bf83caeb /server/middlewares/servers.ts
parentadc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff)
downloadPeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst
PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'server/middlewares/servers.ts')
-rw-r--r--server/middlewares/servers.ts3
1 files changed, 2 insertions, 1 deletions
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 @@
1import * as express from 'express' 1import * as express from 'express'
2import { getHostWithPort } from '../helpers/express-utils' 2import { getHostWithPort } from '../helpers/express-utils'
3import { HttpStatusCode } from '../../shared/core-utils/miscs/http-error-codes'
3 4
4function setBodyHostsPort (req: express.Request, res: express.Response, next: express.NextFunction) { 5function setBodyHostsPort (req: express.Request, res: express.Response, next: express.NextFunction) {
5 if (!req.body.hosts) return next() 6 if (!req.body.hosts) return next()
@@ -9,7 +10,7 @@ function setBodyHostsPort (req: express.Request, res: express.Response, next: ex
9 10
10 // Problem with the url parsing? 11 // Problem with the url parsing?
11 if (hostWithPort === null) { 12 if (hostWithPort === null) {
12 return res.sendStatus(500) 13 return res.sendStatus(HttpStatusCode.INTERNAL_SERVER_ERROR_500)
13 } 14 }
14 15
15 req.body.hosts[i] = hostWithPort 16 req.body.hosts[i] = hostWithPort