mirror of
https://github.com/coredns/coredns.git
synced 2025-12-06 10:25:10 -05:00
plugin/rewrite: add handling of TTL field rewrites (#2048)
Resolves: #1981 Signed-off-by: Paul Greenberg <greenpau@outlook.com>
This commit is contained in:
@@ -133,7 +133,7 @@ func newNameRule(nextAction string, args ...string) (Rule, error) {
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("Invalid regex pattern in a name rule: %s", args[1])
|
||||
}
|
||||
return ®exNameRule{nextAction, regexPattern, plugin.Name(args[2]).Normalize(), ResponseRule{}}, nil
|
||||
return ®exNameRule{nextAction, regexPattern, plugin.Name(args[2]).Normalize(), ResponseRule{Type: "name"}}, nil
|
||||
default:
|
||||
return nil, fmt.Errorf("A name rule supports only exact, prefix, suffix, substring, and regex name matching")
|
||||
}
|
||||
@@ -162,6 +162,7 @@ func newNameRule(nextAction string, args ...string) (Rule, error) {
|
||||
plugin.Name(args[2]).Normalize(),
|
||||
ResponseRule{
|
||||
Active: true,
|
||||
Type: "name",
|
||||
Pattern: responseRegexPattern,
|
||||
Replacement: plugin.Name(args[6]).Normalize(),
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user