aboutsummaryrefslogtreecommitdiff
path: root/brokenlinks/worker_test.go
diff options
context:
space:
mode:
authorShulhan <ms@kilabit.info>2026-02-05 03:29:49 +0700
committerShulhan <ms@kilabit.info>2026-02-05 03:29:49 +0700
commitd8a892eb2f28b3ef4c2625c682d255f4f616cae2 (patch)
treea29eb320d5f6d482521e619a73694dfca3eb17be /brokenlinks/worker_test.go
parentfa31e0a656d03fe3744c70a1171e3831647923c9 (diff)
downloadjarink-d8a892eb2f28b3ef4c2625c682d255f4f616cae2.tar.xz
brokenlinks: check for redirect during scan
If the request redirected, use the "Location" value in the response header as the parent URL instead of from the original link in queue.
Diffstat (limited to 'brokenlinks/worker_test.go')
-rw-r--r--brokenlinks/worker_test.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/brokenlinks/worker_test.go b/brokenlinks/worker_test.go
index 2867338..122221e 100644
--- a/brokenlinks/worker_test.go
+++ b/brokenlinks/worker_test.go
@@ -35,6 +35,10 @@ func TestGenURLRelative(t *testing.T) {
parentURL: `https://domain/a/b/page.HTML`,
relPath: `c`,
expURL: `https://domain/a/b/c`,
+ }, {
+ parentURL: `https://domain/a/b/page.HTML`,
+ relPath: `../c.html`,
+ expURL: `https://domain/a/c.html`,
}}
for _, tc := range listCase {
parentURL, _ := url.Parse(tc.parentURL)