Skip to content

fix: accept bracketed IPv6 netlocs in domain_filter#144

Merged
adbar merged 2 commits into
adbar:masterfrom
santhreal:fix/domain-filter-bracketed-ipv6
Jul 20, 2026
Merged

fix: accept bracketed IPv6 netlocs in domain_filter#144
adbar merged 2 commits into
adbar:masterfrom
santhreal:fix/domain-filter-bracketed-ipv6

Conversation

@santhreal

Copy link
Copy Markdown
Contributor

domain_filter accepted bare IPv6 literals like ::1 but rejected the bracketed netloc urlsplit produces for a normal IPv6 URL. check_url therefore returned None for every properly formed IPv6 HTTP URL, while IPv4 peers passed.

Accept [addr] and [addr]:port with the same port rules as IPv4.

from courlan import check_url
check_url("http://[2001:db8::1]/page")
# was None

urlsplit produces [addr] or [addr]:port for valid IPv6 URLs, but
domain_filter only recognized unbracketed IP literals, so check_url
dropped every properly formed IPv6 URL.
@codecov

codecov Bot commented Jul 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.78%. Comparing base (6f0f507) to head (1f5de32).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #144   +/-   ##
=======================================
  Coverage   99.77%   99.78%           
=======================================
  Files          14       14           
  Lines         905      915   +10     
  Branches      173      176    +3     
=======================================
+ Hits          903      913   +10     
  Misses          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.

@adbar
adbar merged commit ac225ee into adbar:master Jul 20, 2026
12 checks passed
santhreal added a commit to santhreal/courlan that referenced this pull request Jul 20, 2026
Resolve unit_tests conflict with adbar#144 bracketed IPv6 cases; keep both suites.
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.

2 participants