Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@smithy/node-http-handler

Package Overview
Dependencies
Maintainers
0
Versions
50
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@smithy/node-http-handler - npm Package Compare versions

Comparing version 3.3.1 to 3.3.2

19

dist-cjs/index.js

@@ -61,4 +61,4 @@ var __create = Object.create;

var timing = {
setTimeout,
clearTimeout
setTimeout: (cb, ms) => setTimeout(cb, ms),
clearTimeout: (timeoutId) => clearTimeout(timeoutId)
};

@@ -151,5 +151,5 @@

let timeoutId = -1;
let hasError = false;
let sendBody = true;
if (expect === "100-continue") {
await Promise.race([
sendBody = await Promise.race([
new Promise((resolve) => {

@@ -161,8 +161,11 @@ timeoutId = Number(timing.setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));

timing.clearTimeout(timeoutId);
resolve();
resolve(true);
});
httpRequest.on("response", () => {
timing.clearTimeout(timeoutId);
resolve(false);
});
httpRequest.on("error", () => {
hasError = true;
timing.clearTimeout(timeoutId);
resolve();
resolve(false);
});

@@ -172,3 +175,3 @@ })

}
if (!hasError) {
if (sendBody) {
writeBody(httpRequest, request.body);

@@ -175,0 +178,0 @@ }

export const timing = {
setTimeout: setTimeout,
clearTimeout: clearTimeout,
setTimeout: (cb, ms) => setTimeout(cb, ms),
clearTimeout: (timeoutId) => clearTimeout(timeoutId),
};

@@ -8,5 +8,5 @@ import { Readable } from "stream";

let timeoutId = -1;
let hasError = false;
let sendBody = true;
if (expect === "100-continue") {
await Promise.race([
sendBody = await Promise.race([
new Promise((resolve) => {

@@ -18,8 +18,11 @@ timeoutId = Number(timing.setTimeout(resolve, Math.max(MIN_WAIT_TIME, maxContinueTimeoutMs)));

timing.clearTimeout(timeoutId);
resolve();
resolve(true);
});
httpRequest.on("response", () => {
timing.clearTimeout(timeoutId);
resolve(false);
});
httpRequest.on("error", () => {
hasError = true;
timing.clearTimeout(timeoutId);
resolve();
resolve(false);
});

@@ -29,3 +32,3 @@ }),

}
if (!hasError) {
if (sendBody) {
writeBody(httpRequest, request.body);

@@ -32,0 +35,0 @@ }

@@ -6,4 +6,4 @@ /**

export declare const timing: {
setTimeout: typeof setTimeout;
clearTimeout: typeof clearTimeout;
setTimeout: (cb: (...ignored: any[]) => void | unknown, ms?: number) => number;
clearTimeout: (timeoutId: string | number | undefined | unknown) => void;
};

@@ -6,4 +6,4 @@ /**

export declare const timing: {
setTimeout: typeof setTimeout;
clearTimeout: typeof clearTimeout;
setTimeout: (cb: (...ignored: any[]) => void | unknown, ms?: number) => number;
clearTimeout: (timeoutId: string | number | undefined | unknown) => void;
};
{
"name": "@smithy/node-http-handler",
"version": "3.3.1",
"version": "3.3.2",
"description": "Provides a way to make requests",

@@ -29,6 +29,6 @@ "scripts": {

"dependencies": {
"@smithy/abort-controller": "^3.1.8",
"@smithy/protocol-http": "^4.1.7",
"@smithy/querystring-builder": "^3.0.10",
"@smithy/types": "^3.7.1",
"@smithy/abort-controller": "^3.1.9",
"@smithy/protocol-http": "^4.1.8",
"@smithy/querystring-builder": "^3.0.11",
"@smithy/types": "^3.7.2",
"tslib": "^2.6.2"

@@ -35,0 +35,0 @@ },

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc