tk-http icon indicating copy to clipboard operation
tk-http copied to clipboard

Encoder.done_headers should return false when content-length=0

Open hh9527 opened this issue 7 years ago • 1 comments

encoder.add_length(0).unwrap();
if encoder.done_headers().unwrap() {
  // this should be unreachable
}

hh9527 avatar Dec 15 '17 03:12 hh9527

Well, I think an empty body is still a body. We return false when it's 304, or similar thing where body is omitted or prohibited. And I think it's still possible to do write_body(b""). The application knows that body is empty itself.

Do you have the case where this doesn't work?

tailhook avatar Dec 15 '17 09:12 tailhook