Socket
Socket
Sign inDemoInstall

fastify-static

Package Overview
Dependencies
Maintainers
6
Versions
55
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fastify-static - npm Package Compare versions

Comparing version 0.10.0 to 0.10.1

3

index.js

@@ -40,2 +40,5 @@ 'use strict'

this.finished = true
if (reply.res.statusCode === 304) {
reply.send('')
}
cb()

@@ -42,0 +45,0 @@ }

6

package.json
{
"name": "fastify-static",
"version": "0.10.0",
"version": "0.10.1",
"description": "Plugin for serving static files as fast as possible.",

@@ -29,3 +29,3 @@ "main": "index.js",

"dependencies": {
"fastify-plugin": "^0.2.1",
"fastify-plugin": "^1.0.0",
"readable-stream": "^2.3.6",

@@ -43,4 +43,4 @@ "send": "^0.16.0"

"standard": "^11.0.0",
"tap": "^11.0.1"
"tap": "^11.1.4"
}
}

@@ -165,3 +165,3 @@ 'use strict'

t.test('register /static/', t => {
t.plan(9)
t.plan(10)

@@ -282,2 +282,27 @@ const pluginOptions = {

})
t.test('304', t => {
t.plan(5 + GENERIC_RESPONSE_CHECK_COUNT)
simple.concat({
method: 'GET',
url: 'http://localhost:' + fastify.server.address().port + '/static/index.html'
}, (err, response, body) => {
t.error(err)
const etag = response.headers.etag
t.strictEqual(response.statusCode, 200)
t.strictEqual(body.toString(), indexContent)
genericResponseChecks(t, response)
simple.concat({
method: 'GET',
url: 'http://localhost:' + fastify.server.address().port + '/static/index.html',
headers: {
'if-none-match': etag
}
}, (err, response, body) => {
t.error(err)
t.strictEqual(response.statusCode, 304)
})
})
})
})

@@ -284,0 +309,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