Skip to content

Commit

Permalink
fix: set s3 region to auto
Browse files Browse the repository at this point in the history
  • Loading branch information
christophwitzko committed Feb 18, 2024
1 parent e06e10a commit ffc8525
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions internal/config/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ func (s *ServerConfig) CreateS3Client() (*s3.Client, error) {
s3Cfg, err := awsConfig.LoadDefaultConfig(context.TODO(),
awsConfig.WithEndpointResolverWithOptions(aws.EndpointResolverWithOptionsFunc(s.r2CloudflareEndpointResolver)),
awsConfig.WithCredentialsProvider(staticCredentialsProvider),
awsConfig.WithRegion("auto"),
)
if err != nil {
return nil, err
Expand Down
1 change: 1 addition & 0 deletions internal/server/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ func createS3Client(t *testing.T) (*s3.Client, func()) {
}, nil
})),
awsConfig.WithCredentialsProvider(credentials.NewStaticCredentialsProvider("test", "test", "")),
awsConfig.WithRegion("auto"),
)
require.NoError(t, err)
return s3.NewFromConfig(s3Cfg), ts.Close
Expand Down

0 comments on commit ffc8525

Please sign in to comment.