From 46aae951cd61d459c7e67fd835fdcd4a707eeefc Mon Sep 17 00:00:00 2001 From: Rasmus Dahlberg Date: Sat, 25 Mar 2023 18:07:08 +0100 Subject: Send answer w/o connect for bad URL too --- main.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main.go') diff --git a/main.go b/main.go index 6fcdd00..52ea628 100644 --- a/main.go +++ b/main.go @@ -146,12 +146,13 @@ func work(ctx context.Context, opts *options.Options, cli *http.Client, question cctx, cancel := context.WithTimeout(ctx, opts.Timeout) defer cancel() + answer := qna.Answer{Domain: question.Domain} req, err := http.NewRequestWithContext(cctx, http.MethodGet, "https://"+question.Domain, nil) if err != nil { + answerCh <- answer return } - answer := qna.Answer{Domain: question.Domain} rsp, err := cli.Do(req) if err != nil { answerCh <- answer -- cgit v1.2.3