aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/rewrite.go
diff options
context:
space:
mode:
authorGravatar Francois Tur <ftur@infoblox.com> 2018-07-08 03:18:01 -0400
committerGravatar Miek Gieben <miek@miek.nl> 2018-07-08 08:18:01 +0100
commit774546243036c52ff6e3ad524594e68b59c3a919 (patch)
tree22f466b2d07e92faf91d1eba7d7e716f7d6783c1 /plugin/rewrite/rewrite.go
parent6ec1978340de48e25ff77b032040e0b39805d84c (diff)
downloadcoredns-774546243036c52ff6e3ad524594e68b59c3a919.tar.gz
coredns-774546243036c52ff6e3ad524594e68b59c3a919.tar.zst
coredns-774546243036c52ff6e3ad524594e68b59c3a919.zip
plugin/rewrite - extend edns0 local variable support with metadata (#1928)
* - add support of metadata values for edns0 local variables * - comments from review. * - simplify label check. Add UT * - enhance check for Labels, add UT - remove IsMetadataSet * - edns0 variable - if variable is not found just ignore the rewrite.
Diffstat (limited to 'plugin/rewrite/rewrite.go')
-rw-r--r--plugin/rewrite/rewrite.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/plugin/rewrite/rewrite.go b/plugin/rewrite/rewrite.go
index 7389c68eb..b4bdd5e20 100644
--- a/plugin/rewrite/rewrite.go
+++ b/plugin/rewrite/rewrite.go
@@ -42,7 +42,7 @@ func (rw Rewrite) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg
state := request.Request{W: w, Req: r}
for _, rule := range rw.Rules {
- switch result := rule.Rewrite(state); result {
+ switch result := rule.Rewrite(ctx, state); result {
case RewriteDone:
respRule := rule.GetResponseRule()
if respRule.Active == true {
@@ -71,7 +71,7 @@ func (rw Rewrite) Name() string { return "rewrite" }
// Rule describes a rewrite rule.
type Rule interface {
// Rewrite rewrites the current request.
- Rewrite(state request.Request) Result
+ Rewrite(ctx context.Context, state request.Request) Result
// Mode returns the processing mode stop or continue.
Mode() string
// GetResponseRule returns the rule to rewrite response with, if any.