mirror of
https://github.com/nodejs/node.git
synced 2025-08-16 06:08:50 +02:00
http: be more aggressive to reply 400, 408 and 431
As long as data of the in-flight response is not yet written to the socket, we can reply an error response without corrupting the client. PR-URL: https://github.com/nodejs/node/pull/44818 Reviewed-By: Paolo Insogna <paolo@cowtech.it> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ricky Zhou <0x19951125@gmail.com>
This commit is contained in:
parent
d3dd49fe2b
commit
6475a87216
6 changed files with 12 additions and 15 deletions
|
@ -81,9 +81,7 @@ server.listen(0, common.mustCall(() => {
|
|||
assert.strictEqual(second, true);
|
||||
assert.strictEqual(
|
||||
response,
|
||||
// Empty because of https://github.com/nodejs/node/commit/e8d7fedf7cad6e612e4f2e0456e359af57608ac7
|
||||
// 'HTTP/1.1 408 Request Timeout\r\nConnection: close\r\n\r\n'
|
||||
''
|
||||
'HTTP/1.1 408 Request Timeout\r\nConnection: close\r\n\r\n'
|
||||
);
|
||||
server.close();
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue