diff options
-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) |