New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Accept Numbers as body in send() #1406
Comments
Hey @artushin, Thanks for pointing this regression out! I believe I introduced it when updating the way we handle optional parameters here: https://github.com/restify/node-restify/blob/5.x/lib/response.js#L273-L277 Is there a reliable way to differentiate between a body that is a |
To clarify, we run into the problem where: Clear: |
I'm labeling this as a |
I think you should choose a convention and document it for the last case.
Off the top of my head, a status code makes the most sense there
semantically but I would go with whatever maintains the old API convention
in order to prevent regressions.
…On Mon, Jul 17, 2017 at 7:11 PM William Blankenship < ***@***.***> wrote:
To clarify, we run into the problem where:
Clear: resp.send(200, '200')
Clear: resp.send('200')
Clear: resp.send(200, 200)
Ambiguous: resp.send(200)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#1406 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ABgVBvTVbFvXQjJ5K7pVmu3yWo63w3tiks5sO_YygaJpZM4OU10R>
.
|
I think the last case should also be a status code. |
@yunong @rajatkumar @DonutEspresso thoughts? |
Agree with status code, I think it would be more confusing to break that API given the historical/legacy use cases. |
Fixed by: #1609 |
Feature Request
5.0 breaks the ability to send numbers as a body in
send()
. I'd like to add them back.Use Case
Example API
Are you willing and able to implement this?
The text was updated successfully, but these errors were encountered: