Closed SeanTAllen closed 9 months ago
I do understand the reason to come up with this fix, but I would suggest another way to fix it. Either we remove the None
part from the function argument, or we add a check in both the .bytes()
and .array()
method, that adds a content-length of 0
if it is not yet set and if no Transfer-Encoding: chunked
header is set. In this case the Content-Length
header must be omitted.
@mfelsche i think that the "send no body" helper methods that work with content length of None (or would work with such a change) are a big boon. For something like a one shot redirect, one shouldn't have to supply bytes. I'm not sure what the best way to accomplish is while playing nice with chunked content. This seems relatively small, do you have time to take over?
I can take this over and try to ensure that all responses created have a content-length header, unless they are chunked.
awesome. thanks @mfelsche. i am sure you will do a better job than i would.
Not setting it makes some clients unhappy.