yog2-kernel
Advanced tools
Comparing version 0.0.21 to 0.0.22
{ | ||
"name": "yog2-kernel", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "yog2 kernel", | ||
@@ -30,2 +30,3 @@ "main": "index.js", | ||
"colors": "^1.0.3", | ||
"compressible": "~2.0.1", | ||
"compression": "1.2.2", | ||
@@ -32,0 +33,0 @@ "cookie-parser": "1.3.3", |
@@ -0,1 +1,3 @@ | ||
var compressible = require('compressible'); | ||
module.exports.compression = function(app, conf){ | ||
@@ -5,2 +7,18 @@ return function(){ | ||
}; | ||
}; | ||
module.exports.compression.defaultConf = { | ||
filter: function(req, res){ | ||
if (res.bigpipe && Object.keys(res.bigpipe.sources).length !== 0){ | ||
return false; | ||
} | ||
var type = res.getHeader('Content-Type'); | ||
if (type === undefined || !compressible(type)) { | ||
return false; | ||
} | ||
return true; | ||
} | ||
}; |
Sorry, the diff of this file is not supported yet
30566
767
17
+ Addedcompressible@~2.0.1