parse::<Uri> fails to parse uris with triple slash after scheme
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 1.4k
- Forks
- 378
- Avg merge
- 1d 21h
- Merged PRs (30d)
- 5
Description
URIs that reference resources on a local filesystem often use URIs of the format <scheme>://<path_to_file>. If the path is absolute that leads to URIs with 3 slashes after the scheme like unix:///var/run/socket.sock
The following expression panics with InvalidUri(InvalidFormat):
"unix:///path/to/foo.sock".parse::<Uri>().unwrap();
while a similar expression using a relative file path like unix://relative/path/to.sock works just fine.
While I understand that the http crate does not aim to provide a completely compliant URI parser I still think this should be fixed here because:
- There are http services that do listen on unix sockets (docker for example)
- Allowing relative
fileandunixURIs while not allowing absolute ones is inconsistent
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 at the Uri parser entry point exercised by "unix:///path/to/foo.sock". Reproduce the InvalidUri(InvalidFormat) panic, compare it with the working relative-path form, and verify that absolute triple-slash unix or file-style URIs parse without breaking existing relative URI behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- networking
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100