Skip to content

Commit 82401bb

Browse files
committed
refactor: re-add hack to only import node-http on non-web
1 parent 95aa6c0 commit 82401bb

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

packages/core/src/shared/awsClientBuilderV3.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,6 @@ import { partialClone } from './utilities/collectionUtils'
3636
import { selectFrom } from './utilities/tsUtils'
3737
import { once } from './utilities/functionUtils'
3838
import { isWeb } from './extensionGlobals'
39-
import { NodeHttpHandler } from '@smithy/node-http-handler'
4039

4140
export type AwsClientConstructor<C> = new (o: AwsClientOptions) => C
4241

@@ -96,7 +95,11 @@ export class AWSClientBuilderV3 {
9695
const requestTimeout = 30000
9796
return isWeb()
9897
? new FetchHttpHandler({ keepAlive: true, requestTimeout })
99-
: new NodeHttpHandler({ httpAgent: { keepAlive: true }, httpsAgent: { keepAlive: true }, requestTimeout })
98+
: new (require('@smithy/node-http-handler').NodeHttpHandler)({
99+
httpAgent: { keepAlive: true },
100+
httpsAgent: { keepAlive: true },
101+
requestTimeout,
102+
})
100103
}
101104

102105
private getHttpClient = once(this.buildHttpClient.bind(this))

0 commit comments

Comments
 (0)