Sitelet https://github.com/nodejs/node/pull/44818/commits/f83171fb8071085a07fd2b966817248066ea1c87
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
http: be more aggressive to reply 400, 408 and 431
fix lint
  • Loading branch information
ywave620 committed Sep 29, 2022
commit f83171fb8071085a07fd2b966817248066ea1c87
12 changes: 5 additions & 7 deletions lib/_http_server.js
Original file line number Diff line number Diff line change
Expand Up @@ -823,13 +823,11 @@ function socketOnError(e) {
}

if (!this.server.emit('clientError', e, this)) {
if (this.writable &&
// Cautions must be taken to avoid corrupting the remote peer,
// reply an error segment if
// no in-flight ServerResponse
(!this._httpMessage ||
// or data of the in-flight one is not yet written to this socket
!this._httpMessage._headerSent)) {
// Cautions must be taken to avoid corrupting the remote peer,
// reply an error segment if no in-flight ServerResponse
// or data of the in-flight one is not yet written to this socket
Comment thread
ywave620 marked this conversation as resolved.
Outdated
if (this.writable &&
(!this._httpMessage || !this._httpMessage._headerSent)) {
let response;

switch (e.code) {
Expand Down