summaryrefslogtreecommitdiff
path: root/plugins/websockets/wildcard.go
blob: 2f1c6601d02756135b483f8dd3bc7d5f9ee1b492 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
package websockets

import "strings"

type wildcard struct {
	prefix string
	suffix string
}

func (w wildcard) match(s string) bool {
	return len(s) >= len(w.prefix)+len(w.suffix) && strings.HasPrefix(s, w.prefix) && strings.HasSuffix(s, w.suffix)
}