mirror of
https://github.com/minio/minio.git
synced 2024-12-24 06:05:55 -05:00
s3: Return XMinioInvalidObjectName if the object contains null char (#16372)
This commit is contained in:
parent
57fd02ee57
commit
ebd4388cca
@ -170,6 +170,13 @@ func IsValidObjectPrefix(object string) bool {
|
|||||||
if strings.Contains(object, `//`) {
|
if strings.Contains(object, `//`) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
// This is valid for AWS S3 but it will never
|
||||||
|
// work with file systems, we will reject here
|
||||||
|
// to return object name invalid rather than
|
||||||
|
// a cryptic error from the file system.
|
||||||
|
if strings.ContainsRune(object, 0) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user