aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/edns0.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/rewrite/edns0.go')
-rw-r--r--plugin/rewrite/edns0.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/plugin/rewrite/edns0.go b/plugin/rewrite/edns0.go
index 074dd3ebf..e97f04d95 100644
--- a/plugin/rewrite/edns0.go
+++ b/plugin/rewrite/edns0.go
@@ -203,7 +203,10 @@ func (rule *edns0VariableRule) ruleData(ctx context.Context, state request.Reque
fetcher := metadata.ValueFunc(ctx, rule.variable[1:len(rule.variable)-1])
if fetcher != nil {
- return []byte(fetcher()), nil
+ value := fetcher()
+ if len(value) > 0 {
+ return []byte(value), nil
+ }
}
return nil, fmt.Errorf("unable to extract data for variable %s", rule.variable)