Skip to content

Commit be0accd

Browse files
authored
fix: panic due to potentially uncomparable wrapped fn in express_resolve (#2500)
1 parent 4334b43 commit be0accd

File tree

2 files changed

+10
-7
lines changed

2 files changed

+10
-7
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
{
2+
"id": "4160aee8-b320-4fc5-bb03-0e0f5b068f5c",
3+
"type": "bugfix",
4+
"description": "Prevent potential panic caused by invalid comparison of credentials.",
5+
"modules": [
6+
"service/s3"
7+
]
8+
}

service/s3/express_resolve.go

+2-7
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,9 @@ func finalizeExpressCredentials(o *Options, c *Client) {
2424
}
2525

2626
// Operation config finalizer: update the sigv4 credentials on the default
27-
// express provider if it changed to ensure different cache keys
27+
// express provider in case it changed to ensure different cache keys
2828
func finalizeOperationExpressCredentials(o *Options, c Client) {
29-
p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider)
30-
if !ok {
31-
return
32-
}
33-
34-
if c.options.Credentials != o.Credentials {
29+
if p, ok := o.ExpressCredentials.(*defaultS3ExpressCredentialsProvider); ok {
3530
o.ExpressCredentials = p.CloneWithBaseCredentials(o.Credentials)
3631
}
3732
}

0 commit comments

Comments
 (0)