mirror of
https://github.com/gogrlx/nats-server.git
synced 2026-04-14 02:07:59 -07:00
handles 0 length tokens correctly
Without this nats-req '$JS.TEMPLATE..DELETE' '' causes a panic
This commit is contained in:
committed by
Derek Collison
parent
7ee7c19fc7
commit
dc207be04f
@@ -1190,13 +1190,12 @@ func isSubsetMatch(tokens []string, test string) bool {
|
||||
return true
|
||||
}
|
||||
t1 := tokens[i]
|
||||
|
||||
l = len(t1)
|
||||
if l == 0 {
|
||||
return false
|
||||
}
|
||||
if t1[0] == fwc && l == 1 {
|
||||
if l == 0 || t1[0] == fwc && l == 1 {
|
||||
return false
|
||||
}
|
||||
|
||||
if t1[0] == pwc && len(t1) == 1 {
|
||||
m := t2[0] == pwc && len(t2) == 1
|
||||
if !m {
|
||||
|
||||
Reference in New Issue
Block a user