mirror of
https://github.com/minio/minio.git
synced 2024-12-26 23:25:54 -05:00
Add object name validation
This commit is contained in:
parent
e7992320c1
commit
6ebb48b4ea
@ -20,6 +20,7 @@ import (
|
||||
"io"
|
||||
"regexp"
|
||||
"time"
|
||||
"unicode/utf8"
|
||||
)
|
||||
|
||||
type Storage interface {
|
||||
@ -86,5 +87,11 @@ func IsValidBucket(bucket string) bool {
|
||||
}
|
||||
|
||||
func IsValidObject(object string) bool {
|
||||
if len(object) > 1024 || len(object) == 0 {
|
||||
return false
|
||||
}
|
||||
if !utf8.Valid(object) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user