aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2020-01-09 08:50:00 +0100
committerChocobozzz <me@florianbigard.com>2020-01-09 08:51:27 +0100
commitc08579e14fe712cb2264a25daea956e682574335 (patch)
tree4fccffa0c4e40f8539eaf4b796a03de007925132
parentfb770ff9e61ca063004dd98edb772283452a71f8 (diff)
downloadPeerTube-c08579e14fe712cb2264a25daea956e682574335.tar.gz
PeerTube-c08579e14fe712cb2264a25daea956e682574335.tar.zst
PeerTube-c08579e14fe712cb2264a25daea956e682574335.zip
Add correct status on not found video
-rw-r--r--server/lib/client-html.ts5
1 files changed, 4 insertions, 1 deletions
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 {
37 static async getWatchHTMLPage (videoId: string, req: express.Request, res: express.Response) { 37 static async getWatchHTMLPage (videoId: string, req: express.Request, res: express.Response) {
38 // Let Angular application handle errors 38 // Let Angular application handle errors
39 if (!validator.isInt(videoId) && !validator.isUUID(videoId, 4)) { 39 if (!validator.isInt(videoId) && !validator.isUUID(videoId, 4)) {
40 res.status(404)
40 return ClientHtml.getIndexHTML(req, res) 41 return ClientHtml.getIndexHTML(req, res)
41 } 42 }
42 43
@@ -47,7 +48,8 @@ export class ClientHtml {
47 48
48 // Let Angular application handle errors 49 // Let Angular application handle errors
49 if (!video || video.privacy === VideoPrivacy.PRIVATE || video.privacy === VideoPrivacy.INTERNAL || video.VideoBlacklist) { 50 if (!video || video.privacy === VideoPrivacy.PRIVATE || video.privacy === VideoPrivacy.INTERNAL || video.VideoBlacklist) {
50 return ClientHtml.getIndexHTML(req, res) 51 res.status(404)
52 return html
51 } 53 }
52 54
53 let customHtml = ClientHtml.addTitleTag(html, escapeHTML(video.name)) 55 let customHtml = ClientHtml.addTitleTag(html, escapeHTML(video.name))
@@ -77,6 +79,7 @@ export class ClientHtml {
77 79
78 // Let Angular application handle errors 80 // Let Angular application handle errors
79 if (!entity) { 81 if (!entity) {
82 res.status(404)
80 return ClientHtml.getIndexHTML(req, res) 83 return ClientHtml.getIndexHTML(req, res)
81 } 84 }
82 85