aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2018-05-24 15:34:16 +0200
committerChocobozzz <me@florianbigard.com>2018-05-24 15:34:16 +0200
commita00a8f09f9108d1d00d03a9de82f44d395c3efc7 (patch)
tree34a4b122290733ba7571f5e129c6fe2c6a4c57ca
parentd14a9532a1363b464d6d15fce86afc4983a8357e (diff)
downloadPeerTube-a00a8f09f9108d1d00d03a9de82f44d395c3efc7.tar.gz
PeerTube-a00a8f09f9108d1d00d03a9de82f44d395c3efc7.tar.zst
PeerTube-a00a8f09f9108d1d00d03a9de82f44d395c3efc7.zip
Don't render opengraph tags of private videos
-rw-r--r--server/controllers/client.ts3
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'
6import { CONFIG, EMBED_SIZE, OPENGRAPH_AND_OEMBED_COMMENT, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers' 6import { CONFIG, EMBED_SIZE, OPENGRAPH_AND_OEMBED_COMMENT, STATIC_MAX_AGE, STATIC_PATHS } from '../initializers'
7import { asyncMiddleware } from '../middlewares' 7import { asyncMiddleware } from '../middlewares'
8import { VideoModel } from '../models/video/video' 8import { VideoModel } from '../models/video/video'
9import { VideoPrivacy } from '../../shared/models/videos'
9 10
10const clientsRouter = express.Router() 11const 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)