From 919623aa6a16eb9c9e511b62f7756d1e8c01d08a Mon Sep 17 00:00:00 2001 From: Vincent Boivin Date: Sun, 27 Sep 2020 20:52:11 -0400 Subject: [PATCH 1/2] http2: add updateSettings to both http2 servers Allow the user to update the server settings after using http2.createSecureServer() or after using http2.createServer(). Fixes: https://github.com/nodejs/node/issues/35353 --- doc/api/http2.md | 26 +++++++++ lib/internal/http2/core.js | 12 +++++ test/parallel/test-http2-update-settings.js | 59 +++++++++++++++++++++ 3 files changed, 97 insertions(+) create mode 100644 test/parallel/test-http2-update-settings.js diff --git a/doc/api/http2.md b/doc/api/http2.md index bc3bebd11b9c71..cb2806f9410147 100644 --- a/doc/api/http2.md +++ b/doc/api/http2.md @@ -1879,6 +1879,19 @@ A value of `0` will disable the timeout behavior on incoming connections. The socket timeout logic is set up on connection, so changing this value only affects new connections to the server, not any existing connections. +#### `server.updateSettings([settings])` + + +* `settings` {HTTP/2 Settings Object} + +Used to update the server with the provided settings. + +Throws `ERR_HTTP2_INVALID_SETTING_VALUE` for invalid `settings` values + +Throws `ERR_INVALID_ARG_TYPE` for invalid `settings` argument + ### Class: `Http2SecureServer` + +* `settings` {HTTP/2 Settings Object} + +Used to update the server with the provided settings. + +Throws `ERR_HTTP2_INVALID_SETTING_VALUE` for invalid `settings` values + +Throws `ERR_INVALID_ARG_TYPE` for invalid `settings` argument + ### `http2.createServer(options[, onRequestHandler])`