Browse Source
Update weed/s3api/s3api_bucket_config.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
pull/6987/head
Chris Lu
3 months ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
9 additions and
1 deletions
-
weed/s3api/s3api_bucket_config.go
|
@ -124,7 +124,15 @@ func (s3a *S3ApiServer) getBucketConfig(bucket string) (*BucketConfig, s3err.Err |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Load CORS configuration from .s3metadata
|
|
|
// Load CORS configuration from .s3metadata
|
|
|
if corsConfig, err := s3a.loadCORSFromMetadata(bucket); err == nil { |
|
|
|
|
|
|
|
|
if corsConfig, err := s3a.loadCORSFromMetadata(bucket); err != nil { |
|
|
|
|
|
if err == filer_pb.ErrNotFound { |
|
|
|
|
|
// Missing metadata is not an error; fall back cleanly
|
|
|
|
|
|
glog.V(2).Infof("CORS metadata not found for bucket %s, falling back to default behavior", bucket) |
|
|
|
|
|
} else { |
|
|
|
|
|
// Log parsing or validation errors
|
|
|
|
|
|
glog.Errorf("Failed to load CORS configuration for bucket %s: %v", bucket, err) |
|
|
|
|
|
} |
|
|
|
|
|
} else { |
|
|
config.CORS = corsConfig |
|
|
config.CORS = corsConfig |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|