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

koa-static-cache

Package Overview
Dependencies
Maintainers
9
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 5.1.0 to 5.1.1

5

HISTORY.md
5.1.1 / 2017-06-13
==================
* fix: only load file under options.dir (#67)
5.1.0 / 2017-06-01

@@ -3,0 +8,0 @@ ==================

12

index.js

@@ -22,2 +22,3 @@ var crypto = require('crypto')

dir = dir || options.dir || process.cwd()
dir = path.normalize(dir)
var enableGzip = !!options.gzip

@@ -57,4 +58,3 @@ var filePrefix = path.normalize(options.prefix.replace(/^\//, ''))

// normalize for `//index`
var filename = safeDecodeURIComponent(path.normalize(ctx.path))
var filename = path.normalize(safeDecodeURIComponent(ctx.path))
var file = files.get(filename)

@@ -74,5 +74,11 @@

var fullpath = path.join(dir, filename)
// files that can be accessd should be under options.dir
if (fullpath.indexOf(dir) !== 0) {
return await next()
}
var s
try {
s = await fs.stat(path.join(dir, filename))
s = await fs.stat(fullpath)
} catch (err) {

@@ -79,0 +85,0 @@ return await next()

{
"name": "koa-static-cache",
"description": "Static cache for koa",
"version": "5.1.0",
"version": "5.1.1",
"author": {

@@ -6,0 +6,0 @@ "name": "Jonathan Ong",

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