Split response body type into own function (#566)

This allows removing the hack where we create a Response with an empty `reader`,
then immediately mutate it to set the real reader. It also happens to allow us
to get rid of 3 fields of Response that were only used to pass information to
`stream_to_reader`.

I've tried to keep the structure and logic of the body calculation as close to
the same as possible, for ease of review and to avoid introducing bugs. I think
there are some followup fixes we can make to the logic, which will be made
easier by having it in a self contained function.
This commit is contained in:
Jacob Hoffman-Andrews
2022-12-03 10:22:53 -08:00
committed by GitHub
parent cf687381bd
commit d8225b22ed
3 changed files with 56 additions and 41 deletions

View File

@@ -109,10 +109,6 @@ impl Unit {
}
}
pub fn is_head(&self) -> bool {
self.method.eq_ignore_ascii_case("head")
}
pub fn resolver(&self) -> ArcResolver {
self.agent.state.resolver.clone()
}