From 7baaf5a719fd2d769ff6aa724743d14cee12ea4c Mon Sep 17 00:00:00 2001 From: pooya parsa Date: Thu, 23 Apr 2020 00:13:09 +0200 Subject: [PATCH] revert: revert node brotli support (#276) This reverts commit 074f98cbdf409473357b2cd24cd6cb13fe75f149. --- lib/plugin.js | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/lib/plugin.js b/lib/plugin.js index 3cbfc6c..a7fcc0f 100644 --- a/lib/plugin.js +++ b/lib/plugin.js @@ -4,13 +4,6 @@ import defu from 'defu' const globalName = '<%= globalName %>' -// Check Node.js brotli support -let brotliSupported -if (process.server) { - const zlib = require('zlib') - brotliSupported = typeof zlib.createBrotliDecompress == 'function' -} - // Axios.prototype cannot be modified const axiosExtra = { setBaseURL (baseURL) { @@ -213,8 +206,8 @@ export default (ctx, inject) => { } <% } %> - // Don't accept brotli encoding because Node can't parse it - if (process.server && !brotliSupported) { + if (process.server) { + // Don't accept brotli encoding because Node can't parse it axiosOptions.headers.common['accept-encoding'] = 'gzip, deflate' }