Skip to content

Commit

Permalink
Revert "feat(plugin): enable server brotli if supported (closes nuxt-…
Browse files Browse the repository at this point in the history
…community#276)"

This reverts commit 074f98c.
  • Loading branch information
ITJesse committed Apr 22, 2020
1 parent 86d16cf commit aacc7c6
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions lib/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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'
}

Expand Down

0 comments on commit aacc7c6

Please sign in to comment.