URL stringifies to invalid URL: Err(EmptyHost)
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.6k
- Forks
- 406
- PR merge metrics
- No merged PRs in 30d
Description
Found with KLEE.
let u = Url::parse("WS:\u{34f}").unwrap() succeeds, but u.as_str() returns ws:/// which is an invalid URL and doesn't parse the next time.
Both Chrome and Firefox consider the original URL to be invalid.
I also found another example of differing behavior by accident (mistyped the unicode codepoint value when verifying in a browser). The URL WS:\u{35f} is invalid in Chrome and rust-url, but parses successfully in Firefox (gets returned as ws://xn--zn7c).
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the KLEE examples with Url::parse, especially WS:\u{34f} and WS:\u{35f}, then inspect how the parsed URL is returned by as_str(). Compare parsing and stringification against the Chrome, Firefox, and rust-url behaviors described in the issue; done means the invalid ws:/// round trip is addressed without changing the documented handling of the second example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 38/100