Commit b938a28d authored by Kevin Atkinson's avatar Kevin Atkinson

Always require the prefix in shard identifier.

parent a156e6fa
......@@ -73,13 +73,12 @@ func ParseShardFunc(str string) (*ShardIdV1, error) {
if len(str) == 0 {
return nil, fmt.Errorf("empty shard identifier")
}
if str[0] == '/' {
trimmed := strings.TrimPrefix(str, PREFIX)
if str == trimmed { // nothing trimmed
return nil, fmt.Errorf("invalid prefix in shard identifier: %s", str)
return nil, fmt.Errorf("invalid or no prefix in shard identifier: %s", str)
}
str = trimmed
}
parts := strings.Split(str, "/")
if len(parts) != 3 {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment