diff --git a/deadseeker/responsefetcher.py b/deadseeker/responsefetcher.py index 15f995a..b1676fa 100644 --- a/deadseeker/responsefetcher.py +++ b/deadseeker/responsefetcher.py @@ -68,6 +68,10 @@ async def _do_get( async with session.get(url) as response: timer.stop() resp.status = response.status + # Because of redirects the url might have changed. Update it here. + # This fixes https://github.com/ScholliYT/Broken-Links-Crawler-Action/issues/39 + urltarget.url = str(response.real_url) + if has_html(response) and is_onsite(urltarget): resp.html = await response.text() diff --git a/test/mock_server/index.html b/test/mock_server/index.html index 1dc59c3..77ca184 100644 --- a/test/mock_server/index.html +++ b/test/mock_server/index.html @@ -11,5 +11,9 @@