aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/class.go
diff options
context:
space:
mode:
authorGravatar Miek Gieben <miek@miek.nl> 2018-07-01 20:01:17 +0100
committerGravatar GitHub <noreply@github.com> 2018-07-01 20:01:17 +0100
commit99800a687c5da6b5b9c42ad0431e21151828612a (patch)
tree447d777a8e9c3763cb418de2e9c065c7d91e43bc /plugin/rewrite/class.go
parent0b326e26865af91474703322d5d9b1eb1e45a8ff (diff)
downloadcoredns-99800a687c5da6b5b9c42ad0431e21151828612a.tar.gz
coredns-99800a687c5da6b5b9c42ad0431e21151828612a.tar.zst
coredns-99800a687c5da6b5b9c42ad0431e21151828612a.zip
plugin/metadata: metadata is just label=value (#1914)
This revert 17d807f0 and re-adds the metadata plugin as a plugin that just sets a label to a value function. Add package documentation on how to use the metadata package. Make it clear that any caching is up to the Func implemented. There are now - no in tree users. We could add the request metadata by default under names that copy request.Request, i.e request/ip - remote IP request/port - remote port Variables.go has been deleted. Signed-off-by: Miek Gieben <miek@miek.nl>
Diffstat (limited to 'plugin/rewrite/class.go')
-rw-r--r--plugin/rewrite/class.go3
1 files changed, 1 insertions, 2 deletions
diff --git a/plugin/rewrite/class.go b/plugin/rewrite/class.go
index b04dabce2..2e54f515c 100644
--- a/plugin/rewrite/class.go
+++ b/plugin/rewrite/class.go
@@ -1,7 +1,6 @@
package rewrite
import (
- "context"
"fmt"
"strings"
@@ -28,7 +27,7 @@ func newClassRule(nextAction string, args ...string) (Rule, error) {
}
// Rewrite rewrites the the current request.
-func (rule *classRule) Rewrite(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) Result {
+func (rule *classRule) Rewrite(w dns.ResponseWriter, r *dns.Msg) Result {
if rule.fromClass > 0 && rule.toClass > 0 {
if r.Question[0].Qclass == rule.fromClass {
r.Question[0].Qclass = rule.toClass