Parsing "http://localhost" as URI results in `path_and_query: Some("/")`
Open
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 378
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 5
Description
use http::uri::Uri;
fn main() {
let uri: Uri = "http://localhost".parse().unwrap();
println!("{:?}", uri.into_parts().path_and_query);
}
Results in:
Some(/)
Is that intended? I could understand path_and_query being Some(""), but Some("/") seems wrong, as there is definitely no / in the input (after the authority).
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 with Rust's Uri parsing and the into_parts() entry point shown in the reproduction. Check the handling of an authority with no explicit path, then confirm the intended URI semantics with project guidance before changing behavior. Done means the result matches the agreed semantics and the reproduction is covered by a regression test.
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
- Needs clarification
- Newbie friendliness
- 25/100