@smithy/node-http-handler
Advanced tools
@@ -475,3 +475,3 @@ 'use strict'; | ||
| const existingSession = existingPool.poll(); | ||
| if (existingSession && !this.config.disableConcurrency) { | ||
| if (existingSession && !this.config.disableConcurrency && !connectionConfiguration.isEventStream) { | ||
| return existingSession; | ||
@@ -576,6 +576,6 @@ } | ||
| } | ||
| async handle(request, { abortSignal, requestTimeout } = {}) { | ||
| async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) { | ||
| if (!this.config) { | ||
| this.config = await this.configProvider; | ||
| this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); | ||
| this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams ?? false); | ||
| if (this.config.maxConcurrentStreams) { | ||
@@ -615,3 +615,3 @@ this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); | ||
| requestTimeout: this.config?.sessionTimeout, | ||
| disableConcurrentStreams: disableConcurrentStreams || false, | ||
| isEventStream, | ||
| }); | ||
@@ -625,3 +625,3 @@ const rejectWithDestroy = (err) => { | ||
| }; | ||
| const queryString = querystringBuilder.buildQueryString(query || {}); | ||
| const queryString = querystringBuilder.buildQueryString(query ?? {}); | ||
| let path = request.path; | ||
@@ -642,3 +642,3 @@ if (queryString) { | ||
| const httpResponse = new protocolHttp.HttpResponse({ | ||
| statusCode: headers[":status"] || -1, | ||
| statusCode: headers[":status"] ?? -1, | ||
| headers: getTransformedHeaders(headers), | ||
@@ -645,0 +645,0 @@ body: req, |
@@ -17,3 +17,3 @@ import http2 from "node:http2"; | ||
| const existingSession = existingPool.poll(); | ||
| if (existingSession && !this.config.disableConcurrency) { | ||
| if (existingSession && !this.config.disableConcurrency && !connectionConfiguration.isEventStream) { | ||
| return existingSession; | ||
@@ -20,0 +20,0 @@ } |
@@ -36,6 +36,6 @@ import { HttpResponse } from "@smithy/protocol-http"; | ||
| } | ||
| async handle(request, { abortSignal, requestTimeout } = {}) { | ||
| async handle(request, { abortSignal, requestTimeout, isEventStream } = {}) { | ||
| if (!this.config) { | ||
| this.config = await this.configProvider; | ||
| this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams || false); | ||
| this.connectionManager.setDisableConcurrentStreams(this.config.disableConcurrentStreams ?? false); | ||
| if (this.config.maxConcurrentStreams) { | ||
@@ -75,3 +75,3 @@ this.connectionManager.setMaxConcurrentStreams(this.config.maxConcurrentStreams); | ||
| requestTimeout: this.config?.sessionTimeout, | ||
| disableConcurrentStreams: disableConcurrentStreams || false, | ||
| isEventStream, | ||
| }); | ||
@@ -85,3 +85,3 @@ const rejectWithDestroy = (err) => { | ||
| }; | ||
| const queryString = buildQueryString(query || {}); | ||
| const queryString = buildQueryString(query ?? {}); | ||
| let path = request.path; | ||
@@ -102,3 +102,3 @@ if (queryString) { | ||
| const httpResponse = new HttpResponse({ | ||
| statusCode: headers[":status"] || -1, | ||
| statusCode: headers[":status"] ?? -1, | ||
| headers: getTransformedHeaders(headers), | ||
@@ -105,0 +105,0 @@ body: req, |
@@ -36,2 +36,14 @@ import type { HttpHandler, HttpRequest } from "@smithy/protocol-http"; | ||
| /** | ||
| * This is derived from the smithyContext object. This signals to the NodeHttp2Handler specifically | ||
| * that the connection pool should not be used to acquire a connection. The event stream should | ||
| * have its own new connection. | ||
| * | ||
| * This does not apply to WebSocket event streams, since there is no pooling. | ||
| * | ||
| * @internal | ||
| */ | ||
| type EventStreamSignal = { | ||
| isEventStream?: boolean; | ||
| }; | ||
| /** | ||
| * A request handler using the node:http2 package. | ||
@@ -54,3 +66,3 @@ * @public | ||
| destroy(): void; | ||
| handle(request: HttpRequest, { abortSignal, requestTimeout }?: HttpHandlerOptions): Promise<{ | ||
| handle(request: HttpRequest, { abortSignal, requestTimeout, isEventStream }?: HttpHandlerOptions & EventStreamSignal): Promise<{ | ||
| response: HttpResponse; | ||
@@ -66,1 +78,2 @@ }>; | ||
| } | ||
| export {}; |
+5
-5
| { | ||
| "name": "@smithy/node-http-handler", | ||
| "version": "4.5.2", | ||
| "version": "4.5.3", | ||
| "description": "Provides a way to make requests", | ||
@@ -29,9 +29,9 @@ "scripts": { | ||
| "dependencies": { | ||
| "@smithy/protocol-http": "^5.3.13", | ||
| "@smithy/querystring-builder": "^4.2.13", | ||
| "@smithy/types": "^4.14.0", | ||
| "@smithy/protocol-http": "^5.3.14", | ||
| "@smithy/querystring-builder": "^4.2.14", | ||
| "@smithy/types": "^4.14.1", | ||
| "tslib": "^2.6.2" | ||
| }, | ||
| "devDependencies": { | ||
| "@smithy/abort-controller": "^4.2.13", | ||
| "@smithy/abort-controller": "^4.2.14", | ||
| "@types/node": "^18.11.9", | ||
@@ -38,0 +38,0 @@ "concurrently": "7.0.0", |
89517
0.52%1908
0.69%