Fix: S3 CORS headers missing for non-existent buckets (#8078)
Fix S3 CORS for non-existent buckets Enable fallback to global CORS configuration when a bucket is not found (s3err.ErrNoSuchBucket). This ensures consistent CORS behavior and prevents information disclosure.
This commit is contained in:
@@ -358,10 +358,10 @@ func TestMiddlewareFallbackWithError(t *testing.T) {
|
||||
description: "Internal errors should not expose CORS headers",
|
||||
},
|
||||
{
|
||||
name: "ErrNoSuchBucket should not trigger fallback",
|
||||
name: "ErrNoSuchBucket should trigger fallback",
|
||||
errCode: s3err.ErrNoSuchBucket,
|
||||
expectedOriginHeader: "",
|
||||
description: "Bucket not found errors should not expose CORS headers",
|
||||
expectedOriginHeader: "https://example.com",
|
||||
description: "Bucket not found errors should expose CORS headers to prevent information disclosure",
|
||||
},
|
||||
{
|
||||
name: "ErrNoSuchCORSConfiguration should trigger fallback",
|
||||
|
||||
Reference in New Issue
Block a user