Skip to content

docs: update outdated res.send() syntax in res.sendFile example (#7588) - #7598

Closed
VaibhavBajpaij wants to merge 1 commit into
expressjs:masterfrom
VaibhavBajpaij:docs/update-res-sendfile-example
Closed

VaibhavBajpaij wants to merge 1 commit into
expressjs:masterfrom
VaibhavBajpaij:docs/update-res-sendfile-example

Conversation

@VaibhavBajpaij

Copy link
Copy Markdown

In \lib/response.js, the documentation comment for
es.sendFile()\ used
es.send(403, 'Sorry! you can't see that.');.

This signature
es.send(status, body)\ was deprecated in Express 4.x and removed in Express 5.0.

This PR updates the example to use the supported syntax:
\\js
res.status(403).send('Sorry! you can't see that.');
\\

Fixes #7588

…essjs#7588)

In lib/response.js, the JSDoc example for res.sendFile() still used the deprecated res.send(status, body) signature from Express 4.x, which was removed in Express 5. Update to the supported res.status(status).send(body) syntax.

Fixes expressjs#7588

Signed-off-by: Vaibhav Bajpai <bajpaivaibhav2005@gmail.com>
@krzysdz

krzysdz commented Nov 15, 2026

Copy link
Copy Markdown
Contributor

Duplicate of #7534

@krzysdz krzysdz marked this as a duplicate of #7534 Nov 15, 2026
@krzysdz krzysdz closed this Nov 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Outdated res.send() syntax in lib/response.js documentation example

2 participants