diff options
author | Chocobozzz <me@florianbigard.com> | 2018-05-24 15:34:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2018-05-24 15:34:16 +0200 |
commit | a00a8f09f9108d1d00d03a9de82f44d395c3efc7 (patch) | |
tree | 34a4b122290733ba7571f5e129c6fe2c6a4c57ca /server/controllers | |
parent | d14a9532a1363b464d6d15fce86afc4983a8357e (diff) | |
download | PeerTube-a00a8f09f9108d1d00d03a9de82f44d395c3efc7.tar.gz PeerTube-a00a8f09f9108d1d00d03a9de82f44d395c3efc7.tar.zst PeerTube-a00a8f09f9108d1d00d03a9de82f44d395c3efc7.zip |
Don't render opengraph tags of private videos
Diffstat (limited to 'server/controllers')
-rw-r--r-- | server/controllers/client.ts | 3 |
1 files changed, 2 insertions, 1 deletions
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' | |||
6 | import { CONFIG, EMBED_SIZE, OPENGRAPH_AND_OEMBED_COMMENT, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers' | 6 | import { CONFIG, EMBED_SIZE, OPENGRAPH_AND_OEMBED_COMMENT, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers' |
7 | import { asyncMiddleware } from '../middlewares' | 7 | import { asyncMiddleware } from '../middlewares' |
8 | import { VideoModel } from '../models/video/video' | 8 | import { VideoModel } from '../models/video/video' |
9 | import { VideoPrivacy } from '../../shared/models/videos' | ||
9 | 10 | ||
10 | const clientsRouter = express.Router() | 11 | const clientsRouter = express.Router() |
11 | 12 | ||
@@ -152,7 +153,7 @@ async function generateWatchHtmlPage (req: express.Request, res: express.Respons | |||
152 | const html = file.toString() | 153 | const html = file.toString() |
153 | 154 | ||
154 | // Let Angular application handle errors | 155 | // Let Angular application handle errors |
155 | if (!video) return res.sendFile(indexPath) | 156 | if (!video || video.privacy === VideoPrivacy.PRIVATE) return res.sendFile(indexPath) |
156 | 157 | ||
157 | const htmlStringPageWithTags = addOpenGraphAndOEmbedTags(html, video) | 158 | const htmlStringPageWithTags = addOpenGraphAndOEmbedTags(html, video) |
158 | res.set('Content-Type', 'text/html; charset=UTF-8').send(htmlStringPageWithTags) | 159 | res.set('Content-Type', 'text/html; charset=UTF-8').send(htmlStringPageWithTags) |