i'm trying to block res.send from sending the response

18 views
Skip to first unread message

Ricardo Ovando

unread,
Jun 2, 2017, 9:26:21 PM6/2/17
to nodejs

i'm trying to block res.send() from sending the response if the headers already have been sent (trying to implement an async code here)


but the difficulty is that i don't want to intervine with the code directly , but using an event or something else


i tried with with process.exit but it kills everything, the 'finish' event is too late because node already sent the response back


i need help please :(

Jérémy Lal

unread,
Jun 3, 2017, 2:47:21 PM6/3/17
to nod...@googlegroups.com
Hi,

your question is about express, you should try

That being said, i suppose the "on-finished" module can help you, and also
might exactly match your needs.

Jérémy


--
Job board: http://jobs.nodejs.org/
New group rules: https://gist.github.com/othiym23/9886289#file-moderation-policy-md
Old group rules: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
---
You received this message because you are subscribed to the Google Groups "nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email to nodejs+unsubscribe@googlegroups.com.
To post to this group, send email to nod...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/nodejs/7c36a5be-b490-41c4-987d-5d1b44886cdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages