mirror of
https://gitlab.torproject.org/tpo/anti-censorship/pluggable-transports/snowflake.git
synced 2025-10-13 20:11:19 -04:00
Update Relay Pattern format to include dollar sign
This commit is contained in:
parent
ddf72025d1
commit
97dea533da
4 changed files with 24 additions and 15 deletions
|
@ -3,9 +3,14 @@ package namematcher
|
|||
import "strings"
|
||||
|
||||
func NewNameMatcher(rule string) NameMatcher {
|
||||
rule = strings.TrimSuffix(rule, "$")
|
||||
return NameMatcher{suffix: strings.TrimPrefix(rule, "^"), exact: strings.HasPrefix(rule, "^")}
|
||||
}
|
||||
|
||||
func IsValidRule(rule string) bool {
|
||||
return strings.HasSuffix(rule, "$")
|
||||
}
|
||||
|
||||
type NameMatcher struct {
|
||||
exact bool
|
||||
suffix string
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue