-
Notifications
You must be signed in to change notification settings - Fork 50
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
Client premature close (abort) not detected #217
Comments
Ref: honojs#217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
Hi @Tomas2D We are aware that the current node-server may not detect connection disconnections in some cases. However, as mentioned in #172, It would be good if we could detect that the connection was really aborted, excluding the case of a normal POST request. |
Based on nodejs/node#46666 we could do this instead. outgoing.on('close', () => {
if (incoming.errored) {
req[getAbortController]().abort(incoming.errored.toString())
} else if (!outgoing.writableFinished) {
req[getAbortController]().abort('Client connection prematurely closed.')
}
}) |
Ref: honojs#217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
Great. PR has been updated. I updated tests also to cover non-GET HTTP requests. |
Ref: honojs#217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
Ref: honojs#217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
* fix: detection of client premature close Ref: #217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com> * fix: improve detection of client premature close Ref: #217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com> * fixup! fix: improve detection of client premature close Ref: #217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com> * fixup! fixup! fix: improve detection of client premature close Ref: #217 Signed-off-by: Tomas Dvorak <toomas2d@gmail.com> --------- Signed-off-by: Tomas Dvorak <toomas2d@gmail.com>
Can we close this issue now? |
Sure. Thank you. |
Detection of client's premature close has been fixed by #107, but lately broken again via ba26b94.
The text was updated successfully, but these errors were encountered: