mirror of
https://github.com/coredns/coredns.git
synced 2025-11-01 02:33:14 -04:00
Use dns.IsSubDomain (#112)
For the match function use the proper thing from go dns. Fix all callers and tests to use this. Fixes: #107
This commit is contained in:
@@ -22,7 +22,7 @@ type Logger struct {
|
||||
func (l Logger) ServeDNS(ctx context.Context, w dns.ResponseWriter, r *dns.Msg) (int, error) {
|
||||
state := middleware.State{W: w, Req: r}
|
||||
for _, rule := range l.Rules {
|
||||
if middleware.Name(state.Name()).Matches(rule.NameScope) {
|
||||
if middleware.Name(rule.NameScope).Matches(state.Name()) {
|
||||
responseRecorder := middleware.NewResponseRecorder(w)
|
||||
rcode, err := l.Next.ServeDNS(ctx, responseRecorder, r)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user