http2-wrapper
Advanced tools
Comparing version 2.1.9 to 2.1.10
{ | ||
"name": "http2-wrapper", | ||
"version": "2.1.9", | ||
"version": "2.1.10", | ||
"description": "HTTP2 client, just with the familiar `https` API", | ||
@@ -5,0 +5,0 @@ "main": "source", |
@@ -312,4 +312,3 @@ 'use strict'; | ||
// This event tells we are ready to listen for the data. | ||
stream.once('response', (headers, flags, rawHeaders) => { | ||
const onResponse = (headers, flags, rawHeaders) => { | ||
// If we were to emit raw request stream, it would be as fast as the native approach. | ||
@@ -320,3 +319,3 @@ // Note that wrapping the raw stream in a Proxy instance won't improve the performance (already tested it). | ||
// Undocumented, but it used by `cacheable-request` | ||
// Undocumented, but it is used by `cacheable-request` | ||
response.url = `${this[kOrigin].origin}${this.path}`; | ||
@@ -367,4 +366,7 @@ | ||
} | ||
}); | ||
}; | ||
// This event tells we are ready to listen for the data. | ||
stream.once('response', onResponse); | ||
// Emits `information` event | ||
@@ -376,2 +378,8 @@ stream.once('headers', headers => this.emit('information', {statusCode: headers[HTTP2_HEADER_STATUS]})); | ||
// https://github.com/nodejs/node/issues/41251 | ||
if (res === null) { | ||
onResponse(trailers, flags, rawTrailers); | ||
return; | ||
} | ||
// Assigns trailers to the response object. | ||
@@ -378,0 +386,0 @@ res.trailers = trailers; |
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
75102
1891