diff options
author | Rigel Kent <sendmemail@rigelk.eu> | 2020-12-07 14:32:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-12-07 14:32:36 +0100 |
commit | 2d53be0267acc49cda46707b885096193a1f4e9c (patch) | |
tree | 887061a34bc67f40acbb96a6278f9544bf83caeb /server/controllers/live.ts | |
parent | adc1f09c0dbd997f34028c1c82d1c118dc8ead80 (diff) | |
download | PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.gz PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.tar.zst PeerTube-2d53be0267acc49cda46707b885096193a1f4e9c.zip |
replace numbers with typed http status codes (#3409)
Diffstat (limited to 'server/controllers/live.ts')
-rw-r--r-- | server/controllers/live.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/server/controllers/live.ts b/server/controllers/live.ts index 5feadae72..ff48b0e21 100644 --- a/server/controllers/live.ts +++ b/server/controllers/live.ts | |||
@@ -2,6 +2,7 @@ import * as cors from 'cors' | |||
2 | import * as express from 'express' | 2 | import * as express from 'express' |
3 | import { mapToJSON } from '@server/helpers/core-utils' | 3 | import { mapToJSON } from '@server/helpers/core-utils' |
4 | import { LiveManager } from '@server/lib/live-manager' | 4 | import { LiveManager } from '@server/lib/live-manager' |
5 | import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' | ||
5 | 6 | ||
6 | const liveRouter = express.Router() | 7 | const liveRouter = express.Router() |
7 | 8 | ||
@@ -24,7 +25,7 @@ function getSegmentsSha256 (req: express.Request, res: express.Response) { | |||
24 | const result = LiveManager.Instance.getSegmentsSha256(videoUUID) | 25 | const result = LiveManager.Instance.getSegmentsSha256(videoUUID) |
25 | 26 | ||
26 | if (!result) { | 27 | if (!result) { |
27 | return res.sendStatus(404) | 28 | return res.sendStatus(HttpStatusCode.NOT_FOUND_404) |
28 | } | 29 | } |
29 | 30 | ||
30 | return res.json(mapToJSON(result)) | 31 | return res.json(mapToJSON(result)) |