-
Notifications
You must be signed in to change notification settings - Fork 30.4k
New issue
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
http.IncomingMessage omits events when aborted on client side #7732
Comments
Are those events expected to be emitted when a |
In this specific case, where the server's requestListener has already been invoked, I would expect the request object to emit at least the |
The server.on('clientError', (err, socket) => {
console.log('server clientError', err);
socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
}); This will cause the request object's I have to say, the docs could probably be improved here for clarity. Also, based on your example, this statement in the docs:
Appears to be at least partially wrong. |
Also ping @nodejs/http if you think I'm missing something here. |
I did overlook that, thank you for the help! |
If you're feeling up to it, sure. |
I can't seem to be able to reproduce it:
|
FWIW, I'm able to reproduce the behavior as reported with master on OS X. |
This issue has been inactive for sufficiently long that it seems like perhaps it should be closed. Feel free to re-open (or leave a comment requesting that it be re-opened) if you disagree. I'm just tidying up and not acting on a super-strong opinion or anything like that. |
When a HTTP client sends a partial body and is then aborted, the corresponding server request object does not emit
end
,close
oraborted
events. Only aclientError
is emitted on the server.I looked at the existing tests concerning request abortion and it seems this is the only case that is untested.
The following code reproduces the problem:
The output shows that the readable stream (
request
) is left waiting for theend
eventThe text was updated successfully, but these errors were encountered: