caddytls: Fix MatchRemoteIP provisoning with multiple CIDR ranges (#4522)

This commit is contained in:
GallopingKylin 2022-01-13 08:56:18 -08:00 committed by GitHub
parent 850e1605df
commit 66de438a98
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -86,14 +86,14 @@ func (m *MatchRemoteIP) Provision(ctx caddy.Context) error {
if err != nil {
return err
}
m.cidrs = cidrs
m.cidrs = append(m.cidrs, cidrs...)
}
for _, str := range m.NotRanges {
cidrs, err := m.parseIPRange(str)
if err != nil {
return err
}
m.notCidrs = cidrs
m.notCidrs = append(m.notCidrs, cidrs...)
}
return nil
}