server: Validate path for bad components in a handler. (#4170)

This commit is contained in:
Harshavardhana
2017-04-24 18:13:46 -07:00
committed by GitHub
parent 0d1e2ab509
commit 48aa2ac392
9 changed files with 135 additions and 10 deletions

View File

@@ -131,6 +131,9 @@ func IsValidObjectName(object string) bool {
// IsValidObjectPrefix verifies whether the prefix is a valid object name.
// Its valid to have a empty prefix.
func IsValidObjectPrefix(object string) bool {
if hasBadPathComponent(object) {
return false
}
if len(object) > 1024 {
return false
}