aboutsummaryrefslogtreecommitdiff
path: root/plugin/rewrite/name.go
diff options
context:
space:
mode:
Diffstat (limited to 'plugin/rewrite/name.go')
-rw-r--r--plugin/rewrite/name.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plugin/rewrite/name.go b/plugin/rewrite/name.go
index 3be1aec4d..84ba99824 100644
--- a/plugin/rewrite/name.go
+++ b/plugin/rewrite/name.go
@@ -71,7 +71,7 @@ func (rule *exactNameRule) Rewrite(ctx context.Context, state request.Request) R
// Rewrite rewrites the current request when the name begins with the matching string.
func (rule *prefixNameRule) Rewrite(ctx context.Context, state request.Request) Result {
if strings.HasPrefix(state.Name(), rule.Prefix) {
- state.Req.Question[0].Name = rule.Replacement + strings.TrimLeft(state.Name(), rule.Prefix)
+ state.Req.Question[0].Name = rule.Replacement + strings.TrimPrefix(state.Name(), rule.Prefix)
return RewriteDone
}
return RewriteIgnored