Skip to content

Commit

Permalink
fix signing middleware not found bug
Browse files Browse the repository at this point in the history
  • Loading branch information
isaiahvita committed Dec 28, 2023
1 parent 71e6af0 commit bb050be
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions aws/retry/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -328,9 +328,18 @@ func AddRetryMiddlewares(stack *smithymiddle.Stack, options AddRetryMiddlewaresO
middleware.LogAttempts = options.LogRetryAttempts
})

if err := stack.Finalize.Insert(attempt, "Signing", smithymiddle.Before); err != nil {
return err
// index retry to before signing, if signing exists
_, ok := stack.Finalize.Get("Signing")
if !ok {
if err := stack.Finalize.Add(attempt, smithymiddle.After); err != nil {
return err
}
} else {
if err := stack.Finalize.Insert(attempt, "Signing", smithymiddle.Before); err != nil {
return err
}
}

if err := stack.Finalize.Insert(&MetricsHeader{}, attempt.ID(), smithymiddle.After); err != nil {
return err
}
Expand Down

0 comments on commit bb050be

Please sign in to comment.