We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hello Sean!
I believe this error handler is troubled.
I expected the call to reqwest::Proxy::http to return Err(InvalidIpv4Address) as the call to reqwest::Url::parse does.
reqwest::Proxy::http
Err(InvalidIpv4Address)
reqwest::Url::parse
fn main() -> Result<(), Box<dyn std::error::Error>> { println!(); const BAD_NEWS: &str = "http://257.317.406.832"; println!("{:?}", reqwest::Url::parse(BAD_NEWS)); // Err(InvalidIpv4Address) println!("{:?}", reqwest::Proxy::http(BAD_NEWS)); // Ok(Proxy(Http(http://http), None)) println!(); Ok(()) }
I think a not - trim_start - starts_with for http:// and https:// will solve the problem.
But, I believe the ideal solution is to remove the automatic error handling. In my mind adjusting the URL belongs exclusively to the library user.
The text was updated successfully, but these errors were encountered:
Successfully merging a pull request may close this issue.
Hello Sean!
I believe this error handler is troubled.
I expected the call to
reqwest::Proxy::http
to returnErr(InvalidIpv4Address)
as the call toreqwest::Url::parse
does.I think a not - trim_start - starts_with for http:// and https:// will solve the problem.But, I believe the ideal solution is to remove the automatic error handling. In my mind adjusting the URL belongs exclusively to the library user.
The text was updated successfully, but these errors were encountered: