diff --git a/fakestorage/bucket.go b/fakestorage/bucket.go index 4026f1a4a0..93c67e537e 100644 --- a/fakestorage/bucket.go +++ b/fakestorage/bucket.go @@ -16,7 +16,8 @@ import ( "github.com/gorilla/mux" ) -var bucketRegexp = regexp.MustCompile(`^[a-zA-Z0-9][a-zA-Z0-9._-]*[a-zA-Z0-9]$`) +// https://cloud.google.com/storage/docs/buckets#naming +var bucketRegexp = regexp.MustCompile(`^[a-z0-9][a-z0-9._-]*[a-z0-9]$`) // CreateBucket creates a bucket inside the server, so any API calls that // require the bucket name will recognize this bucket. diff --git a/fakestorage/bucket_test.go b/fakestorage/bucket_test.go index 977b4926f8..edebddf67b 100644 --- a/fakestorage/bucket_test.go +++ b/fakestorage/bucket_test.go @@ -252,6 +252,7 @@ func TestServerClientBucketCreateValidation(t *testing.T) { "or spaces", "don't even try", "no/slashes/either", + "uppercaseNOTallowed", } for _, bucketName := range bucketNames {