deprecate Normalize and MustNormalize (#4648)

* deprecate normalize and mustnormalize

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* add runtime warning

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* elaborate runtime warning

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>

* include caller info

Signed-off-by: Chris O'Haver <cohaver@infoblox.com>
This commit is contained in:
Chris O'Haver 2021-05-27 07:26:14 -04:00 committed by GitHub
parent b56f2efe54
commit d8a0d97df2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 61 additions and 11 deletions

View file

@ -93,7 +93,7 @@ func parseStanza(c *caddy.Controller) (*Forward, error) {
return f, c.ArgErr()
}
origFrom := f.from
f.from = plugin.Host(f.from).Normalize()[0] // there can only be one here, won't work with non-octet reverse
f.from = plugin.Host(f.from).NormalizeExact()[0] // there can only be one here, won't work with non-octet reverse
if len(f.from) > 1 {
log.Warningf("Unsupported CIDR notation: '%s' expands to multiple zones. Using only '%s'.", origFrom, f.from)
@ -156,7 +156,7 @@ func parseBlock(c *caddy.Controller, f *Forward) error {
return c.ArgErr()
}
for i := 0; i < len(ignore); i++ {
f.ignored = append(f.ignored, plugin.Host(ignore[i]).Normalize()...)
f.ignored = append(f.ignored, plugin.Host(ignore[i]).NormalizeExact()...)
}
case "max_fails":
if !c.NextArg() {