File tree Expand file tree Collapse file tree 1 file changed +5
-6
lines changed
Expand file tree Collapse file tree 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,7 @@ import { partialClone } from './utilities/collectionUtils'
3636import { selectFrom } from './utilities/tsUtils'
3737import { once } from './utilities/functionUtils'
3838import { isWeb } from './extensionGlobals'
39+ import { NodeHttpHandler } from '@smithy/node-http-handler'
3940
4041export type AwsClientConstructor < C > = new ( o : AwsClientOptions ) => C
4142
@@ -92,12 +93,10 @@ export class AWSClientBuilderV3 {
9293 }
9394
9495 private buildHttpClient ( ) {
95- // Workaround for web mode to avoid importing @smithy /node-http-handler unless in node.
96- if ( ! isWeb ( ) ) {
97- const { NodeHttpHandler } = require ( '@smithy/node-http-handler' )
98- return new NodeHttpHandler ( { keepAlive : true } )
99- }
100- return new FetchHttpHandler ( { keepAlive : true } )
96+ const requestTimeout = 30000
97+ return isWeb ( )
98+ ? new FetchHttpHandler ( { keepAlive : true , requestTimeout } )
99+ : new NodeHttpHandler ( { httpAgent : { keepAlive : true } , httpsAgent : { keepAlive : true } , requestTimeout } )
101100 }
102101
103102 private getHttpClient = once ( this . buildHttpClient . bind ( this ) )
You can’t perform that action at this time.
0 commit comments