Fix DNS request context marshaling
This commit is contained in:
@@ -2,6 +2,7 @@ package nsutil
|
||||
|
||||
import (
|
||||
"context"
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"strings"
|
||||
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user