Skip to content

Commit

Permalink
Fix DNS request context marshaling
Browse files Browse the repository at this point in the history
  • Loading branch information
dhaavi committed Nov 17, 2021
1 parent 938a43c commit f4e3eff
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nameserver/nsutil/nsutil.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ package nsutil

import (
"context"
"encoding/json"
"errors"
"fmt"
"strings"
Expand Down Expand Up @@ -45,6 +46,11 @@ func (rf ResponderFunc) ReplyWithDNS(ctx context.Context, request *dns.Msg) *dns
return rf(ctx, request)
}

// MarshalJSON disables JSON marshaling for ResponderFunc.
func (rf ResponderFunc) MarshalJSON() ([]byte, error) {
return json.Marshal(nil)
}

// BlockIP is a ResponderFunc than replies with either 0.0.0.17 or ::17 for
// each A or AAAA question respectively. If there is no A or AAAA question, it
// defaults to replying with NXDomain.
Expand Down

0 comments on commit f4e3eff

Please sign in to comment.