[Fix] Content-Length header on explicit null body response by ognjenjevremovic · Pull Request #1528 · koajs/koa (original) (raw)

added 2 commits

March 18, 2021 18:31

Responding with an empty message, that does not have a Transfer-Encoding header field set, a Content-Length header field is used to provide the anticipated size for a potential payload body.The Content-Length header should be provided in such case(s), so that the user agent does not fail the request / response cycle.

✅ Closes: koajs#1525

Extend upon existing and provide new unit tests, for asserting the content-length header presence and value on the explicit null body responses.

✅ Closes: koajs#1525

3imed-jaberi

jonathanong

This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters

[ Show hidden characters]({{ revealButtonHref }})