This can be tricky, because:
- If a response is set
Content-Length header - we should not encode the body.
- If there neither
Content-Length header nor Transfer-Encoding: chunked - we should encode the body. Hyper can do it easily.
- If there is
Transfer-Encoding: chunked - we should firstly decode the body and to encode it again to avoid double-encoding.
Another issue is - there is some kind of accept logging. In the case of chunked TE it will be broken, as Hyper provides no way to notify when the last body chunk was written.
This can be tricky, because:
Content-Lengthheader - we should not encode the body.Content-Lengthheader norTransfer-Encoding: chunked- we should encode the body. Hyper can do it easily.Transfer-Encoding: chunked- we should firstly decode the body and to encode it again to avoid double-encoding.Another issue is - there is some kind of accept logging. In the case of chunked TE it will be broken, as Hyper provides no way to notify when the last body chunk was written.