X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Flive.ts;h=ff48b0e2135967330df988a9f07543e8505d40bd;hb=83338e45e3d583b09a5f6920ee5516b64448d9c3;hp=fa4c2cc1a300c5e9b3045a145b8863fac071d972;hpb=c6c0fa6cd8fe8f752463d8982c3dbcd448739c4e;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/live.ts b/server/controllers/live.ts index fa4c2cc1a..ff48b0e21 100644 --- a/server/controllers/live.ts +++ b/server/controllers/live.ts @@ -1,10 +1,13 @@ +import * as cors from 'cors' import * as express from 'express' import { mapToJSON } from '@server/helpers/core-utils' import { LiveManager } from '@server/lib/live-manager' +import { HttpStatusCode } from '@shared/core-utils/miscs/http-error-codes' const liveRouter = express.Router() liveRouter.use('/segments-sha256/:videoUUID', + cors(), getSegmentsSha256 ) @@ -22,7 +25,7 @@ function getSegmentsSha256 (req: express.Request, res: express.Response) { const result = LiveManager.Instance.getSegmentsSha256(videoUUID) if (!result) { - return res.sendStatus(404) + return res.sendStatus(HttpStatusCode.NOT_FOUND_404) } return res.json(mapToJSON(result))