I am using Url::parse from the url crate
For example:
let input = "http://example.com:8080/?sort=custom&kind=comm < > ents&scope=discover&time=6mo&page=2";
match Url::parse(&input) {
Ok(u) => println!("Url: {}",u),
Err(err) => println!("Error: {}",err),
}
I would expect this to trigger the Err arm because the input has spaces and also < and >.
But instead, it auto-encodes it and gives:
http://example.com:8080/?sort=custom&kind=comm%20%20%20%20%20%20%20%20%3C%20%20%20%20%3E%20%20%20ents&scope=discover&time=6mo&page=2
How to prevent this and instead trigger the Err arm?