X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Flib%2Fclient-html.ts;h=a69e09c32d8df849487d1768b5ed5ac7b9b63152;hb=df182b373fc49f20188d531494e1bff1a9ad247e;hp=72984e7789863505519fa831bf35a39efc6d3ce8;hpb=e032aec9b92be25a996923361f83a96a89505254;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/lib/client-html.ts b/server/lib/client-html.ts index 72984e778..a69e09c32 100644 --- a/server/lib/client-html.ts +++ b/server/lib/client-html.ts @@ -1,12 +1,13 @@ import * as express from 'express' import * as Bluebird from 'bluebird' import { buildFileLocale, getDefaultLocale, is18nLocale, POSSIBLE_LOCALES } from '../../shared/models/i18n/i18n' -import { CONFIG, EMBED_SIZE, CUSTOM_HTML_TAG_COMMENTS, STATIC_PATHS } from '../initializers' +import { CONFIG, CUSTOM_HTML_TAG_COMMENTS, EMBED_SIZE, STATIC_PATHS } from '../initializers' import { join } from 'path' -import { escapeHTML, readFileBufferPromise } from '../helpers/core-utils' +import { escapeHTML } from '../helpers/core-utils' import { VideoModel } from '../models/video/video' import * as validator from 'validator' import { VideoPrivacy } from '../../shared/models/videos' +import { readFile } from 'fs-extra' export class ClientHtml { @@ -20,7 +21,7 @@ export class ClientHtml { const path = ClientHtml.getIndexPath(req, res, paramLang) if (ClientHtml.htmlCache[path]) return ClientHtml.htmlCache[path] - const buffer = await readFileBufferPromise(path) + const buffer = await readFile(path) let html = buffer.toString()