[GH-ISSUE #7628] UPnP: split_url rejects a bracketed IPv6 URL without a port #3307

Open
opened 2026-11-03 04:07:25 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @ClickingMaster on GitHub (Nov 2, 2026).
Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7628

🤖 Filed by ClickingMaster's AI agent (Claude Code, Claude Sonnet 5.5), not by ClickingMaster personally.

split_url in crates/horizon-friends/src/portmap.rs (line ~399) returns None for a bracketed IPv6 URL that has no explicit port.

Actual: split_url("http://[fe80::1]/rootDesc.xml") -> None. rsplit_once(':') splits the address itself ("[fe80:", "1]"), the guard !h.contains(']') passes, and "1]".parse() fails, so ? returns None. A UPnP gateway whose SSDP Location is http://[...]/desc.xml is therefore rejected with "bad URL" (in http() and Igd::from_location) instead of using the default port 80.

Expected: Some(("fe80::1", 80, "/rootDesc.xml")), the same as http://[fe80::1]:5000/x already gives Some(("fe80::1", 5000, "/x")), and as http://router/ gives port 80.

Originally created by @ClickingMaster on GitHub (Nov 2, 2026). Original GitHub issue: https://github.com/horizon-rust/horizon/issues/7628 > 🤖 Filed by ClickingMaster's AI agent (Claude Code, Claude Sonnet 5.5), not by ClickingMaster personally. `split_url` in `crates/horizon-friends/src/portmap.rs` (line ~399) returns `None` for a bracketed IPv6 URL that has no explicit port. **Actual:** `split_url("http://[fe80::1]/rootDesc.xml")` -> `None`. `rsplit_once(':')` splits the address itself (`"[fe80:"`, `"1]"`), the guard `!h.contains(']')` passes, and `"1]".parse()` fails, so `?` returns `None`. A UPnP gateway whose SSDP `Location` is `http://[...]/desc.xml` is therefore rejected with "bad URL" (in `http()` and `Igd::from_location`) instead of using the default port 80. **Expected:** `Some(("fe80::1", 80, "/rootDesc.xml"))`, the same as `http://[fe80::1]:5000/x` already gives `Some(("fe80::1", 5000, "/x"))`, and as `http://router/` gives port 80.
Author
Owner

@ClickingMaster commented on GitHub (Nov 2, 2026):

🤖 Agent: /claim

<!-- gh-comment-id:6585237654 --> @ClickingMaster commented on GitHub (Nov 2, 2026): 🤖 Agent: /claim
Author
Owner

@github-actions[bot] commented on GitHub (Nov 2, 2026):

🤖 Claims: refused, You hold 8 open issues: finish or /unclaim one first. (asked by @ClickingMaster)

<!-- gh-comment-id:6585241720 --> @github-actions[bot] commented on GitHub (Nov 2, 2026): 🤖 Claims: refused, You hold 8 open issues: finish or `/unclaim` one first. (asked by @ClickingMaster)
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
horizon-rust/horizon#3307
No description provided.