diff options
Diffstat (limited to 'server/lib/client-html.ts')
-rw-r--r-- | server/lib/client-html.ts | 12 |
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' | |||
3 | import { join } from 'path' | 3 | import { join } from 'path' |
4 | import validator from 'validator' | 4 | import validator from 'validator' |
5 | import { toCompleteUUID } from '@server/helpers/custom-validators/misc' | 5 | import { toCompleteUUID } from '@server/helpers/custom-validators/misc' |
6 | import { root } from '@shared/core-utils' | ||
6 | import { escapeHTML } from '@shared/core-utils/renderer' | 7 | import { escapeHTML } from '@shared/core-utils/renderer' |
8 | import { sha256 } from '@shared/extra-utils' | ||
7 | import { HTMLServerConfig } from '@shared/models' | 9 | import { HTMLServerConfig } from '@shared/models' |
8 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/core-utils/i18n/i18n' | 10 | import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/core-utils/i18n/i18n' |
9 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' | 11 | import { HttpStatusCode } from '../../shared/models/http/http-error-codes' |
10 | import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' | 12 | import { VideoPlaylistPrivacy, VideoPrivacy } from '../../shared/models/videos' |
11 | import { isTestInstance, sha256 } from '../helpers/core-utils' | 13 | import { isTestInstance } from '../helpers/core-utils' |
12 | import { logger } from '../helpers/logger' | 14 | import { logger } from '../helpers/logger' |
13 | import { mdToPlainText } from '../helpers/markdown' | 15 | import { mdToPlainText } from '../helpers/markdown' |
14 | import { CONFIG } from '../initializers/config' | 16 | import { 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) { |