DomainMatcher: Prevent illegal domain rules from causing core startup failures (#5430)

Closes https://github.com/XTLS/Xray-core/issues/5429
This commit is contained in:
Meow
2025-12-23 18:14:42 +08:00
committed by GitHub
parent fa64775f07
commit 7f6ceb39f7
5 changed files with 19 additions and 13 deletions

View File

@@ -1,6 +1,7 @@
package strmatcher
import (
"errors"
"regexp"
)
@@ -44,7 +45,7 @@ func (t Type) New(pattern string) (Matcher, error) {
pattern: r,
}, nil
default:
panic("Unknown type")
return nil, errors.New("unk type")
}
}