mirror of https://github.com/minio/minio.git
Removing regexp check and adding string based check, regexp check was unnecessary here (#1627)
This commit is contained in:
parent
b62774d32f
commit
e4958f9757
|
@ -17,19 +17,15 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"regexp"
|
|
||||||
"runtime"
|
"runtime"
|
||||||
"strings"
|
"strings"
|
||||||
"unicode/utf8"
|
"unicode/utf8"
|
||||||
)
|
)
|
||||||
|
|
||||||
// validVolname regexp.
|
|
||||||
var validVolname = regexp.MustCompile(`^.{3,63}$`)
|
|
||||||
|
|
||||||
// isValidVolname verifies a volname name in accordance with object
|
// isValidVolname verifies a volname name in accordance with object
|
||||||
// layer requirements.
|
// layer requirements.
|
||||||
func isValidVolname(volname string) bool {
|
func isValidVolname(volname string) bool {
|
||||||
if !validVolname.MatchString(volname) {
|
if len(volname) < 3 || len(volname) > 63 {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
switch runtime.GOOS {
|
switch runtime.GOOS {
|
||||||
|
|
Loading…
Reference in New Issue