Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
http: close the connection after sending a body without declared length
Previously, if you removed both content-length and transfer-encoding headers, the connection would still be kept-alive by default. This isn't helpful, because without those headers, the only way the client knows when the body is completed is when the connection closes. See https://www.rfc-editor.org/rfc/rfc7230#section-3.3.3 for more details on this message body handling logic (this is case 7). This meant that in effect, if you removed both headers every response came with a 5 second delay at the end (the default KA timeout) before the client could process it. Now, if you remove both headers the connection closes automatically immediately, so the client knows that it has received the whole message body. PR-URL: #46333 Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Paolo Insogna <paolo@cowtech.it>
- Loading branch information