expressjs.com icon indicating copy to clipboard operation
expressjs.com copied to clipboard

Docs: Incorrect statement about `Content-Length` in `res.send` documentation

Open mhassan1 opened this issue 1 year ago • 1 comments

The documentation of res.send says:

This method performs many useful tasks for simple non-streaming responses: For example, it automatically assigns the Content-Length HTTP response header field (unless previously defined) and provides automatic HEAD and HTTP cache freshness support.

Based on the code, it looks like Content-Length will always get set, regardless of whether it's been previously defined. We should fix the documentation to match the true behavior.

mhassan1 avatar Mar 07 '23 14:03 mhassan1