From 15086ddedf9e23fde388fc89a0acf391b0e5d37b Mon Sep 17 00:00:00 2001 From: Mikhail Losev Date: Mon, 20 Feb 2017 11:46:29 +0300 Subject: [PATCH] hack for #1019 issue (#1047) --- src/processing/encoding/index.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/processing/encoding/index.js b/src/processing/encoding/index.js index e8b06ccfe9..5fe2e888a0 100644 --- a/src/processing/encoding/index.js +++ b/src/processing/encoding/index.js @@ -1,5 +1,4 @@ import zlib from 'zlib'; -import brotli from 'brotli'; import charsetEncoder from 'iconv-lite'; import promisify from '../../utils/promisify'; @@ -35,7 +34,7 @@ export async function decodeContent (content, encoding, charset) { content = await inflateWithFallback(content); else if (encoding === BROTLI_CONTENT_ENCODING) - content = new Buffer(brotli.decompress(content)); + content = new Buffer(require('brotli').decompress(content)); charset.fromBOM(content); @@ -52,7 +51,7 @@ export async function encodeContent (content, encoding, charset) { return deflate(content); if (encoding === BROTLI_CONTENT_ENCODING) - return new Buffer(brotli.compress(content)); + return new Buffer(require('brotli').compress(content)); return content; }