feat: disable compressor if set to false/undefined (#4381)

This commit is contained in:
Alexander Lichter 2018-11-21 14:33:03 +00:00 committed by Pooya Parsa
parent 4e74260ae2
commit e4140cee04

View File

@ -73,8 +73,8 @@ export default class Server {
// If only setting for `compression` are provided, require the module and insert
const compression = this.nuxt.resolver.requireModule('compression')
this.useMiddleware(compression(compressor))
} else {
// Else, require own compression middleware
} else if (compressor) {
// Else, require own compression middleware if compressor is actually truthy
this.useMiddleware(compressor)
}
}