From a00a8f09f9108d1d00d03a9de82f44d395c3efc7 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 24 May 2018 15:34:16 +0200 Subject: Don't render opengraph tags of private videos --- server/controllers/client.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'server/controllers') diff --git a/server/controllers/client.ts b/server/controllers/client.ts index 20f7e5c9c..aff00fe6e 100644 --- a/server/controllers/client.ts +++ b/server/controllers/client.ts @@ -6,6 +6,7 @@ import { escapeHTML, readFileBufferPromise, root } from '../helpers/core-utils' import { CONFIG, EMBED_SIZE, OPENGRAPH_AND_OEMBED_COMMENT, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers' import { asyncMiddleware } from '../middlewares' import { VideoModel } from '../models/video/video' +import { VideoPrivacy } from '../../shared/models/videos' const clientsRouter = express.Router() @@ -152,7 +153,7 @@ async function generateWatchHtmlPage (req: express.Request, res: express.Respons const html = file.toString() // Let Angular application handle errors - if (!video) return res.sendFile(indexPath) + if (!video || video.privacy === VideoPrivacy.PRIVATE) return res.sendFile(indexPath) const htmlStringPageWithTags = addOpenGraphAndOEmbedTags(html, video) res.set('Content-Type', 'text/html; charset=UTF-8').send(htmlStringPageWithTags) -- cgit v1.2.3