@ejnshtein/smol-request
Advanced tools
Comparing version 1.0.10 to 1.0.11
{ | ||
"name": "@ejnshtein/smol-request", | ||
"version": "1.0.10", | ||
"version": "1.0.11", | ||
"description": "Tiny http/https request wrapper for Node.js using ESM (13.5 and newer)", | ||
@@ -5,0 +5,0 @@ "main": "Request.js", |
@@ -45,2 +45,3 @@ // docs: https://nodejs.org/dist/latest-v10.x/docs/api/https.html#https_https_request_url_options_callback | ||
const client = url.startsWith('https') ? https : http | ||
let resolved = false | ||
const result = { | ||
@@ -65,2 +66,5 @@ data: null, | ||
function onClose () { | ||
if (resolved) { | ||
return | ||
} | ||
switch (requestOptions.responseType) { | ||
@@ -95,2 +99,3 @@ case 'buffer': { | ||
if (requestOptions.responseType === 'headers') { | ||
resolved = true | ||
return resolve(result) | ||
@@ -103,2 +108,3 @@ } | ||
result.data = stream | ||
resolved = true | ||
return resolve(result) | ||
@@ -105,0 +111,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
15016
284