@@ -6,14 +6,21 @@ import type {
6
6
AwsSdkCredentialsFeatures ,
7
7
} from "@aws-sdk/types" ;
8
8
import type { IHttpRequest } from "@smithy/protocol-http" ;
9
- import type { AwsCredentialIdentityProvider , BuildHandlerArguments , Provider } from "@smithy/types" ;
9
+ import type {
10
+ AwsCredentialIdentityProvider ,
11
+ BuildHandlerArguments ,
12
+ Provider ,
13
+ RetryStrategy ,
14
+ RetryStrategyV2 ,
15
+ } from "@smithy/types" ;
10
16
11
17
/**
12
18
* @internal
13
19
*/
14
20
type PreviouslyResolved = Partial < {
15
21
credentials ?: AwsCredentialIdentityProvider ;
16
22
accountIdEndpointMode ?: Provider < AccountIdEndpointMode > ;
23
+ retryStrategy ?: Provider < RetryStrategy | RetryStrategyV2 > ;
17
24
} > ;
18
25
19
26
/**
@@ -33,6 +40,24 @@ export async function checkFeatures(
33
40
) : Promise < void > {
34
41
// eslint-disable-next-line
35
42
const request = args . request as IHttpRequest ;
43
+
44
+ if ( request . headers ?. [ "smithy-protocol" ] === "rpc-v2-cbor" ) {
45
+ setFeature ( context , "PROTOCOL_RPC_V2_CBOR" , "M" ) ;
46
+ }
47
+
48
+ if ( typeof config . retryStrategy === "function" ) {
49
+ const retryStrategy = await config . retryStrategy ( ) ;
50
+ if ( typeof ( retryStrategy as RetryStrategyV2 ) . acquireInitialRetryToken === "function" ) {
51
+ if ( retryStrategy . constructor ?. name ?. includes ( "Adaptive" ) ) {
52
+ setFeature ( context , "RETRY_MODE_ADAPTIVE" , "F" ) ;
53
+ } else {
54
+ setFeature ( context , "RETRY_MODE_STANDARD" , "E" ) ;
55
+ }
56
+ } else {
57
+ setFeature ( context , "RETRY_MODE_LEGACY" , "D" ) ;
58
+ }
59
+ }
60
+
36
61
if ( typeof config . accountIdEndpointMode === "function" ) {
37
62
const endpointV2 = context . endpointV2 ;
38
63
if ( String ( endpointV2 ?. url ?. hostname ) . match ( ACCOUNT_ID_ENDPOINT_REGEX ) ) {
0 commit comments