summaryrefslogtreecommitdiff
path: root/test/parallel/test-http-server-destroy-socket-on-client-error.js
Commit message (Collapse)AuthorAgeFilesLines
* deps: update llhttp to 5.1.0Fedor Indutny2021-04-101-1/+1
| | | | | | | | PR-URL: https://github.com/nodejs/node/pull/38146 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Robert Nagy <ronagy@icloud.com> Reviewed-By: Jiawen Geng <technicalcute@gmail.com> Reviewed-By: Daniele Belardi <dwon.dnl@gmail.com>
* test: refactor common.expectsErrorRuben Bridgewater2019-12-311-1/+1
| | | | | | | | | | | | | | | | | | | | | | | This completely refactors the `expectsError` behavior: so far it's almost identical to `assert.throws(fn, object)` in case it was used with a function as first argument. It had a magical property check that allowed to verify a functions `type` in case `type` was passed used in the validation object. This pattern is now completely removed and `assert.throws()` should be used instead. The main intent for `common.expectsError()` is to verify error cases for callback based APIs. This is now more flexible by accepting all validation possibilites that `assert.throws()` accepts as well. No magical properties exist anymore. This reduces surprising behavior for developers who are not used to the Node.js core code base. This has the side effect that `common` is used significantly less frequent. PR-URL: https://github.com/nodejs/node/pull/31092 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* http: improve parser error messagesAnna Henningsen2019-07-051-1/+1
| | | | | | | | | | | | | | | Include the library-provided reason in the Error’s `message`. Fixes: https://github.com/nodejs/node/issues/28468 PR-URL: https://github.com/nodejs/node/pull/28487 Reviewed-By: Anto Aravinth <anto.aravinth.cse@gmail.com> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Fedor Indutny <fedor.indutny@gmail.com> Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
* http: send connection: close when closing connYann Hamon2019-03-091-1/+3
| | | | | | | | | | | | | | | | | | | HTTP/1.1 mandates connections which do not support keep-alive and close the connection send the connection: close header, see https://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.10 This page also provides more information: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Connection I understand that HTTP/1.1 defaults to keep-alive - and that the Connection: close header is required when closing a connection. This adds the Connection: close header in the 400 and 414 responses sent on client errors. PR-URL: https://github.com/nodejs/node/pull/26467 Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
* http: destroy the socket on parse errorLuigi Pinca2018-12-031-0/+45
Destroy the socket if the `'clientError'` event is emitted and there is no listener for it. Fixes: https://github.com/nodejs/node/issues/24586 PR-URL: https://github.com/nodejs/node/pull/24757 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>