-
Notifications
You must be signed in to change notification settings - Fork 7.3k
Calling write()
after calling end()
not raising an error
#7477
Comments
Heh, thanks for catching this. It is actually a http module weirdness. I wish we would fix it after initial v0.12 release. |
Cool. I think ending an already ended response should also error, but doesn't right now. And I think all this is the same for the Glad to be of help. :) |
When calling write() after end() has been called on an OutgoingMessage, an error is emitted and the write's callback is called with an instance of Error. Fix nodejs#7477.
@luiscvega @indutny I just created a PR that fixes this issue. |
When calling write() after end() has been called on an OutgoingMessage, an error is emitted and the write's callback is called with an instance of Error. Fix nodejs#7477.
When calling write() after end() has been called on an OutgoingMessage, an error is emitted and the write's callback is called with an instance of Error. Fix #7477. Reviewed-By: Fedor Indutny <fedor@indutny.com>
Should we really emit 'error' if they've already supplied a callback and we're passing the error to that callback? |
@mscdex My implementation was modeled after _stream_writable.js' |
@mscdex I think they follow streams2 approach, whatever it is right now. |
Fixed by 64d6de9. |
According to docs, the code below should raise an error.
"Calling
write()
after callingend()
will raise an error." (http://nodejs.org/api/stream.html#stream_writable_end_chunk_encoding_callback)The text was updated successfully, but these errors were encountered: