diff options
| author | Shulhan <ms@kilabit.info> | 2025-07-02 02:07:43 +0700 |
|---|---|---|
| committer | Shulhan <ms@kilabit.info> | 2025-11-20 17:12:19 +0700 |
| commit | 5301c666eec35699bbb9024678bb37adc057404c (patch) | |
| tree | 384516772bd4f6fc6cbcd08eea407dda89d4bee8 /brokenlinks/brokenlinks_test.go | |
| parent | c5d26d9a6c039816ce8369c34dd5ea33fac660a1 (diff) | |
| download | jarink-5301c666eec35699bbb9024678bb37adc057404c.tar.xz | |
brokenlinks: fix infinite loop on unknown host
On link with invalid domain, it should break and return the error
immediately.
Diffstat (limited to 'brokenlinks/brokenlinks_test.go')
| -rw-r--r-- | brokenlinks/brokenlinks_test.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/brokenlinks/brokenlinks_test.go b/brokenlinks/brokenlinks_test.go index f957ae3..b49bcc5 100644 --- a/brokenlinks/brokenlinks_test.go +++ b/brokenlinks/brokenlinks_test.go @@ -264,6 +264,10 @@ func TestScan(t *testing.T) { Link: `http:/127.0.0.1:11836`, Error: `Get "http:/127.0.0.1:11836": http: no Host in request URL`, Code: brokenlinks.StatusBadLink, + }, { + Link: `https://domain`, + Error: `Get "https://domain": dial tcp: lookup domain: no such host`, + Code: 700, }, }, testUrl + `/broken.html`: []brokenlinks.Broken{ |
