mirror of
https://github.com/coredns/coredns.git
synced 2025-12-27 20:45:19 -05:00
feature: plugin/rewrite: rewrite ANSWER SECTION (#1318)
Resolves: #1313
This commit is contained in:
committed by
John Belamaric
parent
cb3190bab1
commit
258c163bb0
@@ -3,7 +3,6 @@ package rewrite
|
||||
import (
|
||||
"github.com/coredns/coredns/core/dnsserver"
|
||||
"github.com/coredns/coredns/plugin"
|
||||
|
||||
"github.com/mholt/caddy"
|
||||
)
|
||||
|
||||
@@ -32,6 +31,12 @@ func rewriteParse(c *caddy.Controller) ([]Rule, error) {
|
||||
|
||||
for c.Next() {
|
||||
args := c.RemainingArgs()
|
||||
if len(args) < 2 {
|
||||
// Handles rules out of nested instructions, i.e. the ones enclosed in curly brackets
|
||||
for c.NextBlock() {
|
||||
args = append(args, c.Val())
|
||||
}
|
||||
}
|
||||
rule, err := newRule(args...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
|
||||
Reference in New Issue
Block a user