mirror of
https://github.com/minio/minio.git
synced 2025-03-31 01:33:41 -04:00
Merge pull request #216 from harshavardhana/pr_out_add_object_name_validation
This commit is contained in:
commit
27fab98bf9
@ -20,6 +20,7 @@ import (
|
|||||||
"io"
|
"io"
|
||||||
"regexp"
|
"regexp"
|
||||||
"time"
|
"time"
|
||||||
|
"unicode/utf8"
|
||||||
)
|
)
|
||||||
|
|
||||||
type Storage interface {
|
type Storage interface {
|
||||||
@ -86,5 +87,11 @@ func IsValidBucket(bucket string) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func IsValidObject(object string) bool {
|
func IsValidObject(object string) bool {
|
||||||
|
if len(object) > 1024 || len(object) == 0 {
|
||||||
|
return false
|
||||||
|
}
|
||||||
|
if !utf8.Valid(object) {
|
||||||
|
return false
|
||||||
|
}
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user