Skip to content

Commit

Permalink
Fix missing client field
Browse files Browse the repository at this point in the history
  • Loading branch information
rs committed Mar 7, 2022
1 parent 40d0e7d commit 6a67bd7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ import (
"sync"
"time"

"github.com/nextdns/nextdns/host"
"github.com/nextdns/diag/traceroute"
"github.com/nextdns/nextdns/host"
)

type Report struct {
Expand Down Expand Up @@ -49,6 +49,7 @@ type Test struct {
Protocol string `json:",omitempty"`
Client string `json:",omitempty"`
Resolver string `json:",omitempty"`
SrcIP string `json:",omitempty"`
DestIP string `json:",omitempty"`
Server string `json:",omitempty"`
}
Expand Down Expand Up @@ -234,6 +235,9 @@ func test() Test {
if err := j.Decode(&t); err != nil {
fmt.Printf(indent("Cannot decode response: %v\n"), err)
}
if t.Client == "" {
t.Client, t.SrcIP = t.SrcIP, ""
}
fmt.Println(indent(t.String()))
return t
}
Expand Down

0 comments on commit 6a67bd7

Please sign in to comment.