aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/lib/client-html.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r--server/lib/client-html.ts12
1 files changed, 5 insertions, 7 deletions
diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts
index 360b4667f..74788af52 100644
--- a/server/lib/client-html.ts
+++ b/server/lib/client-html.ts
@@ -3,12 +3,14 @@ import { readFile } from 'fs-extra'
3import { join } from 'path' 3import { join } from 'path'
4import validator from 'validator' 4import validator from 'validator'
5import { toCompleteUUID } from '@server/helpers/custom-validators/misc' 5import { toCompleteUUID } from '@server/helpers/custom-validators/misc'
6import { root } from '@shared/core-utils'
6import { escapeHTML } from '@shared/core-utils/renderer' 7import { escapeHTML } from '@shared/core-utils/renderer'
8import { sha256 } from '@shared/extra-utils'
7import { HTMLServerConfig } from '@shared/models' 9import { HTMLServerConfig } from '@shared/models'
8import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/core-utils/i18n/i18n' 10import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/core-utils/i18n/i18n'
9import { HttpStatusCode } from '../../shared/models/http/http-error-codes' 11import { HttpStatusCode } from '../../shared/models/http/http-error-codes'
10import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' 12import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos'
11import { isTestInstance, sha256 } from '../helpers/core-utils' 13import { isTestInstance } from '../helpers/core-utils'
12import { logger } from '../helpers/logger' 14import { logger } from '../helpers/logger'
13import { mdToPlainText } from '../helpers/markdown' 15import { mdToPlainText } from '../helpers/markdown'
14import { CONFIG } from '../initializers/config' 16import { CONFIG } from '../initializers/config'
@@ -343,15 +345,11 @@ class ClientHtml {
343 { cookie: req.cookies?.clientLanguage, paramLang, acceptLanguage: req.headers['accept-language'] } 345 { cookie: req.cookies?.clientLanguage, paramLang, acceptLanguage: req.headers['accept-language'] }
344 ) 346 )
345 347
346 return join(__dirname, '../../../client/dist/' + buildFileLocale(lang) + '/index.html') 348 return join(root(), 'client', 'dist', buildFileLocale(lang), 'index.html')
347 } 349 }
348 350
349 private static getEmbedPath () { 351 private static getEmbedPath () {
350 return join(__dirname, '../../../client/dist/standalone/videos/embed.html') 352 return join(root(), 'client', 'dist', 'standalone', 'videos', 'embed.html')
351 }
352
353 private static addHtmlLang (htmlStringPage: string, paramLang: string) {
354 return htmlStringPage.replace('<html>', `<html lang="${paramLang}">`)
355 } 353 }
356 354
357 private static addManifestContentHash (htmlStringPage: string) { 355 private static addManifestContentHash (htmlStringPage: string) {