fix: skip malformed IPv6 hrefs in fix_relative_urls#142
Open
santhreal wants to merge 2 commits into
Open
Conversation
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 Report✅ All modified and coverable lines are covered by tests. 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. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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