Skip to content

fix: skip malformed IPv6 hrefs in fix_relative_urls#142

Open
santhreal wants to merge 2 commits into
adbar:masterfrom
santhreal:fix/extract-links-malformed-ipv6
Open

fix: skip malformed IPv6 hrefs in fix_relative_urls#142
santhreal wants to merge 2 commits into
adbar:masterfrom
santhreal:fix/extract-links-malformed-ipv6

Conversation

@santhreal

Copy link
Copy Markdown
Contributor

extract_links/fix_relative_urls hits ValueError when malformed IPv6 protocol-relative href //[::1. This PR fixes the regression with a focused test covering the case. RED-GREEN proved; awaiting thermo

urlsplit raises ValueError on unbalanced brackets. Catch that in
fix_relative_urls and get_base_url so extract_links can discard bad
hrefs the same way check_url already does.
Leave _parse/get_base_url to the existing malformed-URL degrade change.
extract_links still crashed on protocol-relative hrefs because those
call urlsplit directly in fix_relative_urls.
@codecov

codecov Bot commented Jul 18, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.77%. Comparing base (f73bb10) to head (6973c80).
⚠️ Report is 2 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##            master     #142      +/-   ##
===========================================
- Coverage   100.00%   99.77%   -0.23%     
===========================================
  Files           12       14       +2     
  Lines          857      908      +51     
  Branches       167      173       +6     
===========================================
+ Hits           857      906      +49     
- Misses           0        2       +2     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant