-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
head requests with content length fail #341
Comments
Thanks for bringing this to my attention! In particular, I think this might be what is causing Surf to error: fn main() -> Result<(), isahc::Error> {
let response = isahc::head("http://download.opensuse.org/update/tumbleweed/repodata/repomd.xml")?;
println!("Status: {}", response.status());
println!("Headers: {:#?}", response.headers());
println!("Body is empty: {}", response.body().is_empty()); // This should be true, but is false instead
Ok(())
} Isahc doesn't throw any errors, but it is returning a streaming body (which happens to return no bytes) instead of an "empty" body. Reproduced with 1.5.0. I can backport a fix to 0.9.x as well if Surf really wants to avoid upgrading. |
It might be best for @Fishrock123 to comment on the 0.9 backport :) Thanks so much for finding the cause so quickly! |
Turns out this actually isn't the underlying problem with the Surf issue in question, #342 is, but this bug deserves to be fixed too! I'll leave this issue open to focus on |
This is now fixed in the 1.5.1 release. |
http-rs/surf#321
Using isahc as a backend to surf, I noted that doing head requests to servers which return a content length fail due to no body being present. The surf developers isolated this to isahc, but they also noted they are using 0.9.
Is this behaviour fixed in 1.0? Or would it be a valid issue in 1.0 as well?
Thanks!
The text was updated successfully, but these errors were encountered: