mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
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.
This commit is contained in:
committed by
Miek Gieben
parent
6ec1978340
commit
7745462430
@@ -1,6 +1,7 @@
|
||||
package rewrite
|
||||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"strings"
|
||||
|
||||
@@ -29,7 +30,7 @@ func newClassRule(nextAction string, args ...string) (Rule, error) {
|
||||
}
|
||||
|
||||
// Rewrite rewrites the the current request.
|
||||
func (rule *classRule) Rewrite(state request.Request) Result {
|
||||
func (rule *classRule) Rewrite(ctx context.Context, state request.Request) Result {
|
||||
if rule.fromClass > 0 && rule.toClass > 0 {
|
||||
if state.Req.Question[0].Qclass == rule.fromClass {
|
||||
state.Req.Question[0].Qclass = rule.toClass
|
||||
|
||||
Reference in New Issue
Block a user