Error out on domain names with wildcards in captive portals

This commit is contained in:
Frank Denis 2025-01-17 23:01:07 +01:00
parent 31e9a7d251
commit 8f2be59a82

View file

@ -170,6 +170,12 @@ func ColdStart(proxy *Proxy) (*CaptivePortalHandler, error) {
if err != nil { if err != nil {
continue continue
} }
if strings.Index(ipsStr, "*") != -1 {
return nil, fmt.Errorf(
"A captive portal rule must use an exact host name at line %d",
1+lineNo,
)
}
var ips []net.IP var ips []net.IP
for _, ip := range strings.Split(ipsStr, ",") { for _, ip := range strings.Split(ipsStr, ",") {
ipStr := strings.TrimSpace(ip) ipStr := strings.TrimSpace(ip)