Shrink code.

This commit is contained in:
buffermet 2024-10-12 21:50:26 +02:00
commit ccb2774814

View file

@ -29,16 +29,12 @@ func tabsToSpaces(s string) string {
} }
func (p *DNSProxy) logRequestAction(m *dns.Msg, clientIP string) { func (p *DNSProxy) logRequestAction(m *dns.Msg, clientIP string) {
var questions []string
for _, q := range m.Question {
questions = append(questions, tabsToSpaces(q.String()))
}
p.Sess.Events.Add(p.Name+".spoofed-request", struct { p.Sess.Events.Add(p.Name+".spoofed-request", struct {
Client string Client string
Questions []string Questions []string
}{ }{
clientIP, clientIP,
questions, questionsToStrings(m.Question),
}) })
} }