]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/client.ts
Fix video view filename
[github/Chocobozzz/PeerTube.git] / server / controllers / client.ts
index 56685f1021326352c91a0f4d970194760c1910bd..65b5a053c9f4004eabe78687feb80c82e79bb412 100644 (file)
@@ -29,7 +29,8 @@ clientsRouter.use(
   embedCSPMiddleware,
   (req: express.Request, res: express.Response) => {
     res.removeHeader('X-Frame-Options')
-    res.sendFile(embedPath)
+    // Don't cache HTML file since it's an index to the immutable JS/CSS files
+    res.sendFile(embedPath, { maxAge: 0 })
   }
 )
 clientsRouter.use(
@@ -72,11 +73,11 @@ export {
 
 // ---------------------------------------------------------------------------
 
-async function serveServerTranslations (req: express.Request, res: express.Response) {
+function serveServerTranslations (req: express.Request, res: express.Response) {
   const locale = req.params.locale
   const file = req.params.file
 
-  if (is18nLocale(locale) && LOCALE_FILES.indexOf(file) !== -1) {
+  if (is18nLocale(locale) && LOCALE_FILES.includes(file)) {
     const completeLocale = getCompleteLocale(locale)
     const completeFileLocale = buildFileLocale(completeLocale)