http_req
http_req copied to clipboard
Relative paths aren't parsed
Relative URis such as /path aren't handled correctly. Rather than .path() and .resource() returning /path, they simply return None.
use http_req::uri::Uri;
fn main() {
// I am expecting `Some("/path")` but receive `None`
println!("{:?}", "/path".parse::<Uri>().path());
}
I'm sorry to say it, but Uri does currently not support relative URIs.
It supports URIs following the general syntax from RFC 3986
Dang, alrighty. Would you like to add support? I thought about submitting a pull request, but I wasn't up to messing with it at the time.
I wasn't going to add support for it soon. You can freely make a pull request, if you want to.