From 2d1666b88bb9346f533f36c1ce903e5c71984c10 Mon Sep 17 00:00:00 2001 From: Simone Basso Date: Fri, 15 Oct 2021 12:00:20 +0200 Subject: [PATCH] fix(wcth): emit empty Addrs when input URL contains addr (#545) Matches the behavior that the legacy TH implements in this situation and reduces slightly the differences. See https://github.com/ooni/probe/issues/1707#issuecomment-944143329 --- internal/cmd/oohelperd/internal/webconnectivity/measure.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/internal/cmd/oohelperd/internal/webconnectivity/measure.go b/internal/cmd/oohelperd/internal/webconnectivity/measure.go index 41453f1..6be2cd8 100644 --- a/internal/cmd/oohelperd/internal/webconnectivity/measure.go +++ b/internal/cmd/oohelperd/internal/webconnectivity/measure.go @@ -76,7 +76,12 @@ func Measure(ctx context.Context, config MeasureConfig, creq *CtrlRequest) (*Ctr select { case cresp.DNS = <-dnsch: default: - // we land here when there's no domain name + // we need to emit a non-nil Addrs to match exactly + // the behavior of the legacy TH + cresp.DNS = CtrlDNSResult{ + Failure: nil, + Addrs: []string{}, + } } cresp.HTTPRequest = <-httpch cresp.TCPConnect = make(map[string]CtrlTCPResult)