Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

koa-static-cache

Package Overview
Dependencies
Maintainers
7
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-static-cache - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

7

HISTORY.md
1.0.10 / 2014-05-18
==================
* bump fs-readdir-recursive, fixed #14
* fix bad argument handling, fixed #20
* should not return gzip buffer when accept encoding not include gzip
1.0.9 / 2014-03-31

@@ -3,0 +10,0 @@ ==================

38

index.js

@@ -11,18 +11,6 @@ var crypto = require('crypto')

var stat = function (file) {
return function (done) {
fs.stat(file, done)
}
}
function gzip(buf) {
return function (done) {
zlib.gzip(buf, done)
}
}
module.exports = function staticCache(dir, options, files) {
if (typeof dir === 'object') {
files = options
options = dir
files = options
dir = null

@@ -106,5 +94,11 @@ }

var acceptGzip = this.acceptsEncodings('gzip') === 'gzip';
if (file.zipBuffer) {
this.set('Content-Encoding', 'gzip')
this.body = file.zipBuffer
if (acceptGzip) {
this.set('Content-Encoding', 'gzip')
this.body = file.zipBuffer
} else {
this.body = file.buffer
}
return

@@ -115,3 +109,3 @@ }

&& file.length > 1024
&& this.acceptsEncodings('gzip') === 'gzip'
&& acceptGzip
&& compressible(file.type)

@@ -163,1 +157,13 @@

}
var stat = function (file) {
return function (done) {
fs.stat(file, done)
}
}
function gzip(buf) {
return function (done) {
zlib.gzip(buf, done)
}
}
{
"name": "koa-static-cache",
"description": "Static cache for koa",
"version": "1.0.9",
"version": "1.0.10",
"author": {

@@ -44,3 +44,3 @@ "name": "Jonathan Ong",

"compressible": "~1.0.1",
"fs-readdir-recursive": "~0.0.1",
"fs-readdir-recursive": ">=0.0.2",
"debug": "*"

@@ -47,0 +47,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc