mirror of
https://github.com/minio/minio.git
synced 2025-11-20 01:50:24 -05:00
Fix s3 compatibility fixes for getBucketLocation,headBucket,deleteBucket (#5842)
- getBucketLocation - headBucket - deleteBucket Should return 404 or NoSuchBucket even for invalid bucket names, invalid bucket names are only validated during MakeBucket operation
This commit is contained in:
committed by
Nitish Tiwari
parent
954142a98f
commit
ccdb7bc286
@@ -261,8 +261,8 @@ func (s *posix) DiskInfo() (info disk.Info, err error) {
|
||||
// compatible way for all operating systems. If volume is not found
|
||||
// an error is generated.
|
||||
func (s *posix) getVolDir(volume string) (string, error) {
|
||||
if !isValidVolname(volume) {
|
||||
return "", errInvalidArgument
|
||||
if volume == "" || volume == "." || volume == ".." {
|
||||
return "", errVolumeNotFound
|
||||
}
|
||||
volumeDir := pathJoin(s.diskPath, volume)
|
||||
return volumeDir, nil
|
||||
@@ -301,6 +301,10 @@ func (s *posix) MakeVol(volume string) (err error) {
|
||||
return err
|
||||
}
|
||||
|
||||
if !isValidVolname(volume) {
|
||||
return errInvalidArgument
|
||||
}
|
||||
|
||||
volumeDir, err := s.getVolDir(volume)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in New Issue
Block a user