X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fclient-html.ts;h=4a4b0d12f9799b1d21455a0cafb16e925e625504;hb=3b0bd70aa05ab82fa30fe67ed4899d44652c703a;hp=1d8a08ed0bfc59a891dab5cfa8aea0031baf4284;hpb=7738273b808f0ff1494f18c4cc13553505e6ac6d;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 1d8a08ed0..4a4b0d12f 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -17,7 +17,7 @@ import { MAccountActor, MChannelActor, MVideo } from '../typings/models' export class ClientHtml { - private static htmlCache: { [ path: string ]: string } = {} + private static htmlCache: { [path: string]: string } = {} static invalidCache () { logger.info('Cleaning HTML cache.') @@ -94,7 +94,7 @@ export class ClientHtml { private static async getIndexHTML (req: express.Request, res: express.Response, paramLang?: string) { const path = ClientHtml.getIndexPath(req, res, paramLang) - if (ClientHtml.htmlCache[ path ]) return ClientHtml.htmlCache[ path ] + if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] const buffer = await readFile(path) @@ -104,7 +104,7 @@ export class ClientHtml { html = ClientHtml.addCustomCSS(html) html = await ClientHtml.addAsyncPluginCSS(html) - ClientHtml.htmlCache[ path ] = html + ClientHtml.htmlCache[path] = html return html } @@ -119,7 +119,7 @@ export class ClientHtml { // Save locale in cookies res.cookie('clientLanguage', lang, { secure: WEBSERVER.SCHEME === 'https', - sameSite: true, + sameSite: 'none', maxAge: 1000 * 3600 * 24 * 90 // 3 months }) @@ -214,21 +214,21 @@ export class ClientHtml { const schemaTags = { '@context': 'http://schema.org', '@type': 'VideoObject', - name: videoNameEscaped, - description: videoDescriptionEscaped, - thumbnailUrl: previewUrl, - uploadDate: video.createdAt.toISOString(), - duration: getActivityStreamDuration(video.duration), - contentUrl: videoUrl, - embedUrl: embedUrl, - interactionCount: video.views + 'name': videoNameEscaped, + 'description': videoDescriptionEscaped, + 'thumbnailUrl': previewUrl, + 'uploadDate': video.createdAt.toISOString(), + 'duration': getActivityStreamDuration(video.duration), + 'contentUrl': videoUrl, + 'embedUrl': embedUrl, + 'interactionCount': video.views } let tagsString = '' // Opengraph Object.keys(openGraphMetaTags).forEach(tagName => { - const tagValue = openGraphMetaTags[ tagName ] + const tagValue = openGraphMetaTags[tagName] tagsString += `` })