Skip to content

Commit 7823924

Browse files
test(s3/cors): Setting an empty allowed origin is not allowed (#838)
1 parent bcd8514 commit 7823924

File tree

2 files changed

+219
-238
lines changed

2 files changed

+219
-238
lines changed

scaleway/resource_object_bucket_test.go

Lines changed: 2 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package scaleway
33
import (
44
"fmt"
55
"reflect"
6+
"regexp"
67
"strings"
78
"testing"
89

@@ -344,27 +345,7 @@ func TestAccScalewayObjectBucket_Cors_EmptyOrigin(t *testing.T) {
344345
max_age_seconds = 3000
345346
}
346347
}`, bucketName),
347-
Check: resource.ComposeTestCheckFunc(
348-
testAccCheckScalewayObjectBucketExists(tt, resourceName),
349-
testAccCheckScalewayObjectBucketCors(tt,
350-
resourceName,
351-
[]*s3.CORSRule{
352-
{
353-
AllowedHeaders: []*string{scw.StringPtr("*")},
354-
AllowedMethods: []*string{scw.StringPtr("PUT"), scw.StringPtr("POST")},
355-
AllowedOrigins: []*string{scw.StringPtr("")},
356-
ExposeHeaders: []*string{scw.StringPtr("x-amz-server-side-encryption"), scw.StringPtr("ETag")},
357-
MaxAgeSeconds: scw.Int64Ptr(3000),
358-
},
359-
},
360-
),
361-
),
362-
},
363-
{
364-
ResourceName: resourceName,
365-
ImportState: true,
366-
ImportStateVerify: true,
367-
ImportStateVerifyIgnore: []string{"force_destroy", "acl"},
348+
ExpectError: regexp.MustCompile("error putting S3 CORS"),
368349
},
369350
},
370351
})

0 commit comments

Comments
 (0)