Open andreypopp opened 11 years ago
I just copied what connect-session does. In some ways I don't mind how it does it and it kinda makes sense to me. It's just middleware that needs to run on the way out of the middleware stack rather than something orthogonal to it as you're proposing.
So, I'm not sure what to do here. Unless there are +1's I'll probably leave it. An example patch would be welcome so I can see how you'd do it. :)
Cheers, Andy
Ah, I see how you do it here : https://github.com/andreypopp/domain-context/blob/master/lib/index.js#L104-L119
It seems that connect-session was implemented before the response became a stream and even streams were introduced into the node's stdlib. But you are probably right — there's no point to fix things which are not broken.
Related connect PRs aren't yet accepted — https://github.com/senchalabs/connect/pull/552
@chilts Did you refactor the code with this? Cheers
Hi @dcworldwide - hmm, I can't quite remember since it was so long ago, however, I'm almost certain I didn't do anything. Does this issue still exist? Does anyone actually use this package? :)
It's better to subscribe to an
finish
event onres
instead of monkey-patching itsend()
method.