cacheable-request
Advanced tools
Comparing version 10.2.0 to 10.2.1
@@ -77,3 +77,3 @@ import EventEmitter from 'node:events'; | ||
}); | ||
const handler = (response) => { | ||
const handler = async (response) => { | ||
if (revalidate) { | ||
@@ -83,2 +83,8 @@ response.status = response.statusCode; | ||
if (!revalidatedPolicy.modified) { | ||
response.resume(); | ||
await new Promise(resolve => { | ||
// Skipping 'error' handler cause 'error' event should't be emitted for 304 response | ||
response | ||
.once('end', resolve); | ||
}); | ||
const headers = convertHeaders(revalidatedPolicy.policy.responseHeaders()); | ||
@@ -85,0 +91,0 @@ response = new Response({ statusCode: revalidate.statusCode, headers, body: revalidate.body, url: revalidate.url }); |
{ | ||
"name": "cacheable-request", | ||
"version": "10.2.0", | ||
"version": "10.2.1", | ||
"description": "Wrap native HTTP requests with RFC compliant cache support", | ||
@@ -36,2 +36,3 @@ "license": "MIT", | ||
"dependencies": { | ||
"@types/http-cache-semantics": "^4.0.1", | ||
"get-stream": "^6.0.1", | ||
@@ -49,3 +50,2 @@ "http-cache-semantics": "^4.1.0", | ||
"@types/get-stream": "^3.0.2", | ||
"@types/http-cache-semantics": "^4.0.1", | ||
"@types/jest": "^29.0.3", | ||
@@ -52,0 +52,0 @@ "@types/node": "^18.7.18", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
52067
18
410
7
+ Added@types/http-cache-semantics@4.0.4(transitive)