Make `clientError` overridable by indutny · Pull Request #4557 · nodejs/node

added 2 commits

January 6, 2016 16:59
`clientError` will have `http.Server`-specific behavior, and we don't
want to shadow it in `tls.Server`.
Make default `clientError` behavior (close socket immediately)
overridable. With this APIs it is possible to write a custom error
handler, and to send, for example, a 400 HTTP response.

    http.createServer(...).on('clientError', function(err, socket) {
      socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
      socket.destroy();
    });

Fix: nodejs#4543

@mscdex mscdex added tls

Issues and PRs related to the tls subsystem.

http

Issues or PRs related to the http subsystem.

semver-major

PRs that contain breaking changes and should be released in the next major version.

labels

Jan 6, 2016

@vkurchatkin vkurchatkin removed http

Issues or PRs related to the http subsystem.

tls

Issues and PRs related to the tls subsystem.

labels

Jan 6, 2016

@mscdex mscdex added tls

Issues and PRs related to the tls subsystem.

http

Issues or PRs related to the http subsystem.

labels

Jan 6, 2016

@vkurchatkin vkurchatkin added tls

Issues and PRs related to the tls subsystem.

and removed tls

Issues and PRs related to the tls subsystem.

labels

Jan 6, 2016

@indutny

@indutny

@indutny

indutny added a commit that referenced this pull request

Jan 7, 2016
`clientError` will have `http.Server`-specific behavior, and we don't
want to shadow it in `tls.Server`.

PR-URL: #4557
Reviewed-By: Brian White <mscdex@mscdex.net>

indutny added a commit that referenced this pull request

Jan 7, 2016
Make default `clientError` behavior (close socket immediately)
overridable. With this APIs it is possible to write a custom error
handler, and to send, for example, a 400 HTTP response.

    http.createServer(...).on('clientError', function(err, socket) {
      socket.end('HTTP/1.1 400 Bad Request\r\n\r\n');
      socket.destroy();
    });

Fix: #4543
PR-URL: #4557
Reviewed-By: Brian White <mscdex@mscdex.net>

This was referenced

Dec 7, 2023

This was referenced

Dec 7, 2023

This was referenced

Dec 7, 2023

This was referenced

Dec 7, 2023

This was referenced

Dec 8, 2023

This was referenced

Dec 8, 2023

This was referenced

Dec 8, 2023