-
Notifications
You must be signed in to change notification settings - Fork 100
New issue
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
Add a flag for forcing a specific http version #161
Conversation
What's left to do here? Why is it a draft? |
@svenstaro we are waiting for the next version of reqwest so we can make use of the newly added |
Note to self: Remove the following from
Edit: Done |
Note to self: Remove connection-related headers when Also, update Edit: Done |
Co-authored-by: Jan Verbeek <jan.verbeek@posteo.nl>
this is needed until seanmonstar/reqwest#1268 gets merged
Three tests are currently failing due to expired certs. I will disable them until https://self-signed.badssl.com/ starts working again. By the way, are there any HTTP version test servers similar to https://badssl.com? Edit: The issue has been resolved so I will re-enable the tests that I've disabled. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good!
src/cli.rs
Outdated
"0.9" | "3" => Err(Error::with_description( | ||
&format!("http version {:?} is not supported", version), | ||
ErrorKind::InvalidValue, | ||
)), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm, possible_versions
makes this unreachable. We could get rid of that and display the list of versions manually, which would also let us hide the 1
alias. Or we could just remove these manual error messages.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since manually listing the versions meant they wouldn't get highlighted, I opted to just remove the manual error messages.
.assert() | ||
.success() | ||
.stdout(predicates::str::contains("GET / HTTP/1.0")) | ||
.stdout(predicates::str::contains("HTTP/1.0 200 OK")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some servers respond to a 1.0 request with a 1.1 response, like httpbin.org and nginx. So this could break in the future, though I don't expect it. Maybe worth a comment?
Resolves #68