fastify-static
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -40,2 +40,5 @@ 'use strict' | ||
this.finished = true | ||
if (reply.res.statusCode === 304) { | ||
reply.send('') | ||
} | ||
cb() | ||
@@ -42,0 +45,0 @@ } |
{ | ||
"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 @@ }) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30568
753
+ Addedfastify-plugin@1.6.1(transitive)
+ Addedsemver@6.3.1(transitive)
- Removedfastify-plugin@0.2.2(transitive)
- Removedsemver@5.7.2(transitive)
Updatedfastify-plugin@^1.0.0