Improve block reason in dns response
This commit is contained in:
@@ -71,8 +71,8 @@ func (br ListBlockReason) GetExtraRR(_ *dns.Msg, _ string, _ interface{}) []dns.
|
||||
|
||||
for _, lm := range br {
|
||||
blockedBy, err := dns.NewRR(fmt.Sprintf(
|
||||
"%s-blockedBy. 0 IN TXT %q",
|
||||
strings.TrimRight(lm.Entity, "."),
|
||||
`%s 0 IN TXT "was blocked by filter lists %s"`,
|
||||
lm.Entity,
|
||||
strings.Join(lm.ActiveLists, ","),
|
||||
))
|
||||
if err == nil {
|
||||
@@ -83,8 +83,8 @@ func (br ListBlockReason) GetExtraRR(_ *dns.Msg, _ string, _ interface{}) []dns.
|
||||
|
||||
if len(lm.InactiveLists) > 0 {
|
||||
wouldBeBlockedBy, err := dns.NewRR(fmt.Sprintf(
|
||||
"%s-wouldBeBlockedBy. 0 IN TXT %q",
|
||||
strings.TrimRight(lm.Entity, "."),
|
||||
`%s 0 IN TXT "would be blocked by filter lists %s"`,
|
||||
lm.Entity,
|
||||
strings.Join(lm.InactiveLists, ","),
|
||||
))
|
||||
if err == nil {
|
||||
|
||||
Reference in New Issue
Block a user