hyperium / hyperium/http

Parsing "http://localhost" as URI results in `path_and_query: Some("/")`

Open
#465 12 comments 2 reactions 0 assignees View on GitHub

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(/)

Playground

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.