Comparing version 10.5.0 to 10.5.1
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const fs_1 = require("fs"); | ||
const CacheableRequest = require("cacheable-request"); | ||
@@ -19,2 +20,3 @@ const EventEmitter = require("events"); | ||
const url_to_options_1 = require("./utils/url-to-options"); | ||
const pEvent = require("p-event"); | ||
const setImmediateAsync = async () => new Promise(resolve => setImmediate(resolve)); | ||
@@ -249,8 +251,11 @@ const pipeline = util_1.promisify(stream.pipeline); | ||
(async () => { | ||
// Promises are executed immediately. | ||
// If there were no `setImmediate` here, | ||
// `promise.json()` would have no effect | ||
// as the request would be sent already. | ||
await setImmediateAsync(); | ||
try { | ||
if (options.body instanceof fs_1.ReadStream) { | ||
await pEvent(options.body, 'open'); | ||
} | ||
// Promises are executed immediately. | ||
// If there were no `setImmediate` here, | ||
// `promise.json()` would have no effect | ||
// as the request would be sent already. | ||
await setImmediateAsync(); | ||
for (const hook of options.hooks.beforeRequest) { | ||
@@ -257,0 +262,0 @@ // eslint-disable-next-line no-await-in-loop |
{ | ||
"name": "got", | ||
"version": "10.5.0", | ||
"version": "10.5.1", | ||
"description": "Human-friendly and powerful HTTP request library for Node.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
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
162333
2375
3