mirror of
https://github.com/coredns/coredns.git
synced 2026-07-18 05:30:13 -04:00
plugin/rewrite: normalize exact cname rewrite targets and preserve all records (#8285)
Signed-off-by: ncesam <rybushkin09@bk.ru>
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
||||
"strconv"
|
||||
"strings"
|
||||
|
||||
"github.com/coredns/coredns/plugin"
|
||||
"github.com/coredns/coredns/plugin/pkg/log"
|
||||
"github.com/coredns/coredns/plugin/pkg/upstream"
|
||||
"github.com/coredns/coredns/request"
|
||||
@@ -139,6 +140,10 @@ func newCNAMERule(nextAction string, args ...string) (Rule, error) {
|
||||
} else {
|
||||
return nil, fmt.Errorf("too few (%d) arguments for a cname rule", len(args))
|
||||
}
|
||||
if rewriteType == ExactMatch {
|
||||
paramFromTarget = plugin.Name(paramFromTarget).Normalize()
|
||||
paramToTarget = plugin.Name(paramToTarget).Normalize()
|
||||
}
|
||||
rule := cnameTargetRule{
|
||||
rewriteType: rewriteType,
|
||||
paramFromTarget: paramFromTarget,
|
||||
|
||||
Reference in New Issue
Block a user