We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
send
Documentation for Reply states that not sending any content results in 204 status response.
Reply
204
https://github.com/fastify/fastify/blob/master/docs/Reply.md#code
If not settled via reply.code, the resulting statusCode will be 200 or 204 if there is not content to send.
reply.code
200
I don't think this is the case, but I might be missing something.
reply.js #37
if (payload === undefined) { if (!this.res.statusCode) { this.res.statusCode = 204 }
From what I can tell, res.statusCode will already be set to 200 (its default value). So calling reply.send() will send status 200 and not 204.
res.statusCode
reply.send()
If the above is correct, I believe the relevant portion of the documentation should be removed.
The text was updated successfully, but these errors were encountered:
Good spot! I tend to say the code is assuming too much and it should not attach a status code. Would you mind sending a PR?
Sorry, something went wrong.
@mcollina You mean we should remove below block and update docs?
if (!this.res.statusCode) { this.res.statusCode = 204 }
Yes.
bd7880c
Merge pull request #265 from nileshmali/master
5d1767c
Fixes #263
No branches or pull requests
Documentation for
Reply
states that not sending any content results in204
status response.https://github.com/fastify/fastify/blob/master/docs/Reply.md#code
I don't think this is the case, but I might be missing something.
reply.js #37
From what I can tell,
res.statusCode
will already be set to200
(its default value). So callingreply.send()
will send status200
and not204
.If the above is correct, I believe the relevant portion of the documentation should be removed.
The text was updated successfully, but these errors were encountered: