From: Chocobozzz Date: Thu, 9 Jan 2020 07:50:00 +0000 (+0100) Subject: Add correct status on not found video X-Git-Tag: v2.1.0-rc.1~62 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=c08579e14fe712cb2264a25daea956e682574335;p=oweals%2Fpeertube.git Add correct status on not found video --- diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 2fcf0c4ea..e59505614 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -37,6 +37,7 @@ export class ClientHtml { static async getWatchHTMLPage (videoId: string, req: express.Request, res: express.Response) { // Let Angular application handle errors if (!validator.isInt(videoId) && !validator.isUUID(videoId, 4)) { + res.status(404) return ClientHtml.getIndexHTML(req, res) } @@ -47,7 +48,8 @@ export class ClientHtml { // Let Angular application handle errors if (!video || video.privacy === VideoPrivacy.PRIVATE || video.privacy === VideoPrivacy.INTERNAL || video.VideoBlacklist) { - return ClientHtml.getIndexHTML(req, res) + res.status(404) + return html } let customHtml = ClientHtml.addTitleTag(html, escapeHTML(video.name)) @@ -77,6 +79,7 @@ export class ClientHtml { // Let Angular application handle errors if (!entity) { + res.status(404) return ClientHtml.getIndexHTML(req, res) }