mirror of
https://github.com/nodejs/node.git
synced 2026-11-21 12:59:16 -05:00
http2: rename function for clarity
The function does not only validate the input but it causes side effects by adding default options to the input object in case the option is not set. PR-URL: https://github.com/nodejs/node/pull/26809 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This commit is contained in:
1 file changed
+3
-3
@@ -607,7 +607,7 @@ function requestOnConnect(headers, options) {
|
||||
// 4. if specified, options.silent must be a boolean
|
||||
//
|
||||
// Also sets the default priority options if they are not set.
|
||||
const validatePriorityOptions = hideStackFrames((options) => {
|
||||
const setAndValidatePriorityOptions = hideStackFrames((options) => {
|
||||
if (options.weight === undefined) {
|
||||
options.weight = NGHTTP2_DEFAULT_WEIGHT;
|
||||
} else if (typeof options.weight !== 'number') {
|
||||
@@ -1451,7 +1451,7 @@ class ClientHttp2Session extends Http2Session {
|
||||
throw new ERR_HTTP2_CONNECT_PATH();
|
||||
}
|
||||
|
||||
validatePriorityOptions(options);
|
||||
setAndValidatePriorityOptions(options);
|
||||
|
||||
if (options.endStream === undefined) {
|
||||
// For some methods, we know that a payload is meaningless, so end the
|
||||
@@ -1839,7 +1839,7 @@ class Http2Stream extends Duplex {
|
||||
|
||||
assertIsObject(options, 'options');
|
||||
options = { ...options };
|
||||
validatePriorityOptions(options);
|
||||
setAndValidatePriorityOptions(options);
|
||||
|
||||
const priorityFn = submitPriority.bind(this, options);
|
||||
|
||||
|
||||
Reference in new issue
Block a user