Skip to content

Commit

Permalink
fix: panic due to potentially uncomparable wrapped fn in express_resolve
Browse files Browse the repository at this point in the history
  • Loading branch information
lucix-aws committed Feb 17, 2024
1 parent 4334b43 commit 6538eb0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .changelog/4160aee8b3204fc5bb030e0f5b068f5c.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"id": "4160aee8-b320-4fc5-bb03-0e0f5b068f5c",
"type": "bugfix",
"description": "Prevent potential panic caused by invalid comparison of credentials.",
"modules": [
"service/s3"
]
}
9 changes: 2 additions & 7 deletions service/s3/express_resolve.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,9 @@ func finalizeExpressCredentials(o *Options, c *Client) {
}

// Operation config finalizer: update the sigv4 credentials on the default
// express provider if it changed to ensure different cache keys
// express provider in case it changed to ensure different cache keys
func finalizeOperationExpressCredentials(o *Options, c Client) {
p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider)
if !ok {
return
}

if c.options.Credentials != o.Credentials {
if p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider); ok {
o.ExpressCredentials = p.CloneWithBaseCredentials(o.Credentials)
}
}
Expand Down

0 comments on commit 6538eb0

Please sign in to comment.