Open
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
file
andunix
URIs while not allowing absolute ones is inconsistent
Metadata
Metadata
Assignees
Labels
No labels