Skip to content

Commit

Permalink
aws/defaults: Fix request metadata headers causing signature errors
Browse files Browse the repository at this point in the history
Fixes the SDK's adding the request metadata headers in the wrong
location within the request handler stack. This created a situation
where a request that was retried would sign the new attempt using the
old value of the header. The header value would then be changed before
sending the request.

This moves the request invocation id to only occur during build,
maintaining its value across all requests attempts. Also moves request
retry metadata header to be before sign, and after build. This ensures
that a new value for each attempt can be set, and included in each
request attempt.

Fix aws#533
Fix aws#521
  • Loading branch information
jasdel committed Apr 21, 2020
1 parent 1b3b54b commit cad4cb9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions aws/defaults/defaults.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,10 +70,10 @@ func Handlers() aws.Handlers {
handlers.Validate.AfterEachFn = aws.HandlerListStopOnError
handlers.Build.PushBackNamed(SDKVersionUserAgentHandler)
handlers.Build.PushBackNamed(AddHostExecEnvUserAgentHander)
handlers.Build.PushFrontNamed(RequestInvocationIDHeaderHandler)
handlers.Build.AfterEachFn = aws.HandlerListStopOnError
handlers.Sign.PushBackNamed(BuildContentLengthHandler)
handlers.Send.PushFrontNamed(RequestInvocationIDHeaderHandler)
handlers.Send.PushFrontNamed(RetryMetricHeaderHandler)
handlers.Sign.PushFrontNamed(RetryMetricHeaderHandler)
handlers.Send.PushBackNamed(ValidateReqSigHandler)
handlers.Send.PushBackNamed(SendHandler)
handlers.Send.PushBackNamed(AttemptClockSkewHandler)
Expand Down

0 comments on commit cad4cb9

Please sign in to comment.