-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Description
Why is the check implemented this way?
if (payload !== undefined || state.reply.res.statusCode === 204) {
state.reply.send()
}I would have expected it to be:
if (payload !== undefined || !state.reply.sent) {
state.reply.send(payload)
}I'm mainly concerned because I have a reply decorator that does this:
reply.code(204).send();and if I use that inside an async handler, reply.send() gets called twice.
Plus I feel like it would be a better developer experience to send an empty response if the developer doesn't call reply.send() inside a handler that resolves to undefined rather than letting the request hang.
Metadata
Metadata
Assignees
Labels
No labels