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

koa-static

Package Overview
Dependencies
Maintainers
10
Versions
27
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

koa-static - npm Package Compare versions

Comparing version 4.0.0 to 4.0.1

6

History.md
4.0.1 / 2017-07-09
==================
* Fix: throw error if error status not 404
* fix `index: false` bug if path is directory
4.0.0 / 2017-07-03

@@ -3,0 +9,0 @@ ==================

17

index.js

@@ -40,12 +40,17 @@

return async function serve (ctx, next) {
let done = false
if (ctx.method === 'HEAD' || ctx.method === 'GET') {
try {
await send(ctx, ctx.path, opts)
done = await send(ctx, ctx.path, opts)
} catch (err) {
await next()
if (err.status !== 404) {
throw err
}
}
return
}
await next()
if (!done) {
await next()
}
}

@@ -64,5 +69,7 @@ }

} catch (err) {
ctx.status = err.status || 500
if (err.status !== 404) {
throw err
}
}
}
}

@@ -5,3 +5,3 @@ {

"repository": "koajs/static",
"version": "4.0.0",
"version": "4.0.1",
"keywords": [

@@ -8,0 +8,0 @@ "koa",

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