diff options
author | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-25 18:07:08 +0100 |
---|---|---|
committer | Rasmus Dahlberg <rasmus@rgdd.se> | 2023-03-25 18:07:08 +0100 |
commit | 46aae951cd61d459c7e67fd835fdcd4a707eeefc (patch) | |
tree | a3e208f428ed14314a57bc8f2d268b111108bbbd | |
parent | 046b19055ea1e230b5e949c241ddcb3f76a45699 (diff) |
Send answer w/o connect for bad URL too
-rw-r--r-- | main.go | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -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 |