mirror of
https://github.com/coredns/coredns.git
synced 2025-10-27 08:14:18 -04:00
This commit is contained in:
committed by
Miek Gieben
parent
9a393ac5c8
commit
f51c110511
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user