mirror of
https://github.com/minio/minio.git
synced 2025-11-23 02:57:42 -05:00
Add bucketName checks for azure and s3 gateway in GetBucketInfo. (#4992)
Gateway interface implementations of GetBucketInfo() under azure and s3 gateway did not perform any bucketname input validation resulting in incorrect responses when the tests are expecting InvalidBucketName. Fixes #4983
This commit is contained in:
committed by
Dee Koder
parent
4c9fae90ff
commit
b415c600e1
@@ -327,6 +327,14 @@ func (a *azureObjects) MakeBucketWithLocation(bucket, location string) error {
|
||||
|
||||
// GetBucketInfo - Get bucket metadata..
|
||||
func (a *azureObjects) GetBucketInfo(bucket string) (bi BucketInfo, e error) {
|
||||
// Verify if bucket (container-name) is valid.
|
||||
// IsValidBucketName has same restrictions as container names mentioned
|
||||
// in azure documentation, so we will simply use the same function here.
|
||||
// Ref - https://docs.microsoft.com/en-us/rest/api/storageservices/naming-and-referencing-containers--blobs--and-metadata
|
||||
if !IsValidBucketName(bucket) {
|
||||
return bi, traceError(BucketNameInvalid{Bucket: bucket})
|
||||
}
|
||||
|
||||
// Azure does not have an equivalent call, hence use
|
||||
// ListContainers with prefix
|
||||
resp, err := a.client.ListContainers(storage.ListContainersParameters{
|
||||
|
||||
Reference in New Issue
Block a user