Fix error when searching for just a literal colon

This commit is contained in:
David Dworken 2024-11-18 15:25:03 -08:00
parent 9a06b07b74
commit f64e466472
No known key found for this signature in database

View File

@ -852,6 +852,9 @@ func parseNonAtomizedToken(token string) (string, any, any, any, error) {
func parseAtomizedToken(ctx context.Context, token string) (string, any, any, error) {
splitToken := splitEscaped(token, ':', 2)
if len(splitToken) != 2 {
return "", nil, nil, fmt.Errorf("search query contains malformed search atom '%s'", token)
}
field := unescape(splitToken[0])
val := unescape(splitToken[1])
switch field {