forked from TrueCloudLab/distribution
e1464fd317
Fixes https://github.com/docker/distribution/issues/3097 Signed-off-by: Yong Wen Chua <lawliet89@users.noreply.github.com>
11 lines
288 B
Go
11 lines
288 B
Go
package strings
|
|
|
|
import (
|
|
"strings"
|
|
)
|
|
|
|
// HasPrefixFold tests whether the string s begins with prefix, interpreted as UTF-8 strings,
|
|
// under Unicode case-folding.
|
|
func HasPrefixFold(s, prefix string) bool {
|
|
return len(s) >= len(prefix) && strings.EqualFold(s[0:len(prefix)], prefix)
|
|
}
|