You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thank you for the issue report and for digging into the issue! Apologies for the regression from 4.x @retrohacker any thoughts on just relaxing the restriction for body in that function? If we include number and boolean it might as well just be open to any possible value?
Thank you for taking the time to open this issue, follow our template, and for linking to a proposed implementation ❤️
I'm 👍 on relaxing the constraints for body, this seems ideal. Since we support custom formatters, anything could be a potentially valid body.
number is a special case in that there is a previous argument that is a number: statusCode. I'd err on the side of keeping the order of the args, in the case where you want to specify a number for body, you must always specify statusCode to disambiguate.
Bug Report
Restify Version
5.x
Node.js Version
Any
Expected behaviour
Under for 4.x, you can respond with
res.json(200, true)
. This sets body totrue
. This is no longer possible under 5.xRelated: #1406
Actual behaviour
Body has no content.
Repro case
res.json(200, true)
Cause
./lib/response.js
on line 272 checks for the type and filters out anything that isn't an object or a string.Are you willing and able to fix this?
Already did. Ready to make a PR once this is given the green light.
https://github.com/revnode/node-restify/commit/8c598eeb8a5315f5758f330791991eb198b1e53b
The text was updated successfully, but these errors were encountered: