Improve block reason in dns response

This commit is contained in:
Daniel
2020-05-19 16:57:13 +02:00
parent c146a61704
commit 65a3456165

View File

@@ -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 {