From 4f5229dc89630e42d403db0ef8de55bcca3559cf Mon Sep 17 00:00:00 2001 From: Vaibhav Bajpai Date: Sun, 15 Nov 2026 12:49:40 +0530 Subject: [PATCH] docs: update outdated res.send() syntax in res.sendFile example (#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 #7588 Signed-off-by: Vaibhav Bajpai --- lib/response.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/response.js b/lib/response.js index 0d5a4ae4d4d..67ef102438e 100644 --- a/lib/response.js +++ b/lib/response.js @@ -364,7 +364,7 @@ res.sendStatus = function sendStatus(statusCode) { * if (yes) { * res.sendFile('/uploads/' + uid + '/' + file); * } else { - * res.send(403, 'Sorry! you can\'t see that.'); + * res.status(403).send('Sorry! you can\'t see that.'); * } * }); * });