@smithy/node-http-handler
Advanced tools
| import node_http2 from "node:http2"; | ||
| export { node_http2 }; |
| import node_https from "node:https"; | ||
| export { node_https }; |
| import node_http2 from "node:http2"; | ||
| export { node_http2 }; |
| import node_https from "node:https"; | ||
| export { node_https }; |
| 'use strict'; | ||
| var protocols = require('@smithy/core/protocols'); | ||
| var node_https = require('node:https'); | ||
| var protocols = require('@smithy/core/protocols'); | ||
| var node_stream = require('node:stream'); | ||
@@ -417,3 +417,4 @@ var http2 = require('node:http2'); | ||
| httpAgentProvider: async () => { | ||
| const { Agent, request } = await import('node:http'); | ||
| const node_http = await import('node:http'); | ||
| const { Agent, request } = node_http.default ?? node_http; | ||
| hRequest = request; | ||
@@ -670,2 +671,3 @@ hAgent = Agent; | ||
| const { constants } = http2; | ||
| class NodeHttp2Handler { | ||
@@ -765,4 +767,4 @@ config; | ||
| ...request.headers, | ||
| [http2.constants.HTTP2_HEADER_PATH]: path, | ||
| [http2.constants.HTTP2_HEADER_METHOD]: method, | ||
| [constants.HTTP2_HEADER_PATH]: path, | ||
| [constants.HTTP2_HEADER_METHOD]: method, | ||
| }); | ||
@@ -769,0 +771,0 @@ if (effectiveRequestTimeout) { |
@@ -1,2 +0,1 @@ | ||
| import { Agent as hsAgent, request as hsRequest } from "node:https"; | ||
| import { HttpResponse, buildQueryString } from "@smithy/core/protocols"; | ||
@@ -6,2 +5,3 @@ import { buildAbortError } from "./build-abort-error"; | ||
| import { getTransformedHeaders } from "./get-transformed-headers"; | ||
| import { node_https } from "./node-https"; | ||
| import { setConnectionTimeout } from "./set-connection-timeout"; | ||
@@ -111,3 +111,3 @@ import { setRequestTimeout } from "./set-request-timeout"; | ||
| if (expectContinue && !this.externalAgent) { | ||
| agent = new (isSSL ? hsAgent : hAgent)({ | ||
| agent = new (isSSL ? node_https.Agent : hAgent)({ | ||
| keepAlive: false, | ||
@@ -150,3 +150,3 @@ maxSockets: Infinity, | ||
| }; | ||
| const requestFunc = isSSL ? hsRequest : hRequest; | ||
| const requestFunc = isSSL ? node_https.request : hRequest; | ||
| const req = requestFunc(nodeHttpsOptions, (res) => { | ||
@@ -224,3 +224,4 @@ const httpResponse = new HttpResponse({ | ||
| httpAgentProvider: async () => { | ||
| const { Agent, request } = await import("node:http"); | ||
| const node_http = await import("node:http"); | ||
| const { Agent, request } = node_http.default ?? node_http; | ||
| hRequest = request; | ||
@@ -235,7 +236,7 @@ hAgent = Agent; | ||
| httpsAgent: (() => { | ||
| if (httpsAgent instanceof hsAgent || typeof httpsAgent?.destroy === "function") { | ||
| if (httpsAgent instanceof node_https.Agent || typeof httpsAgent?.destroy === "function") { | ||
| this.externalAgent = true; | ||
| return httpsAgent; | ||
| } | ||
| return new hsAgent({ keepAlive, maxSockets, ...httpsAgent }); | ||
| return new node_https.Agent({ keepAlive, maxSockets, ...httpsAgent }); | ||
| })(), | ||
@@ -242,0 +243,0 @@ logger, |
@@ -1,7 +0,8 @@ | ||
| import { constants } from "node:http2"; | ||
| import { HttpResponse, buildQueryString } from "@smithy/core/protocols"; | ||
| import { buildAbortError } from "./build-abort-error"; | ||
| import { getTransformedHeaders } from "./get-transformed-headers"; | ||
| import { node_http2 } from "./node-http2"; | ||
| import { NodeHttp2ConnectionManager } from "./node-http2-connection-manager"; | ||
| import { writeRequestBody } from "./write-request-body"; | ||
| const { constants } = node_http2; | ||
| export class NodeHttp2Handler { | ||
@@ -8,0 +9,0 @@ config; |
| import type { Agent as hAgentType } from "node:http"; | ||
| import { Agent as hsAgent } from "node:https"; | ||
| import type { Agent as hsAgentType } from "node:https"; | ||
| import { HttpResponse, type HttpHandler, type HttpRequest } from "@smithy/core/protocols"; | ||
@@ -38,3 +38,3 @@ import type { HttpHandlerOptions, Logger, NodeHttpHandlerOptions, Provider } from "@smithy/types"; | ||
| */ | ||
| static checkSocketUsage(agent: hAgentType | hsAgent, socketWarningTimestamp: number, logger?: Logger): number; | ||
| static checkSocketUsage(agent: hAgentType | hsAgentType, socketWarningTimestamp: number, logger?: Logger): number; | ||
| constructor(options?: NodeHttpHandlerOptions | Provider<NodeHttpHandlerOptions | void>); | ||
@@ -41,0 +41,0 @@ destroy(): void; |
@@ -1,2 +0,2 @@ | ||
| import { type ClientSessionOptions, type SecureClientSessionOptions } from "node:http2"; | ||
| import type { ClientSessionOptions, SecureClientSessionOptions } from "node:http2"; | ||
| import { HttpResponse, type HttpHandler, type HttpRequest } from "@smithy/core/protocols"; | ||
@@ -3,0 +3,0 @@ import type { HttpHandlerOptions, Provider } from "@smithy/types"; |
+1
-1
| { | ||
| "name": "@smithy/node-http-handler", | ||
| "version": "4.7.6", | ||
| "version": "4.7.7", | ||
| "description": "Provides a way to make requests", | ||
@@ -5,0 +5,0 @@ "scripts": { |
95059
0.47%42
10.53%2098
0.58%