Skip to content

Commit 92db780

Browse files
committed
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: #26809 Reviewed-By: Matteo Collina <[email protected]> Reviewed-By: James M Snell <[email protected]>
1 parent bbfa93a commit 92db780

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/internal/http2/core.js

+3-3
Original file line numberDiff line numberDiff line change
@@ -607,7 +607,7 @@ function requestOnConnect(headers, options) {
607607
// 4. if specified, options.silent must be a boolean
608608
//
609609
// Also sets the default priority options if they are not set.
610-
const validatePriorityOptions = hideStackFrames((options) => {
610+
const setAndValidatePriorityOptions = hideStackFrames((options) => {
611611
if (options.weight === undefined) {
612612
options.weight = NGHTTP2_DEFAULT_WEIGHT;
613613
} else if (typeof options.weight !== 'number') {
@@ -1451,7 +1451,7 @@ class ClientHttp2Session extends Http2Session {
14511451
throw new ERR_HTTP2_CONNECT_PATH();
14521452
}
14531453

1454-
validatePriorityOptions(options);
1454+
setAndValidatePriorityOptions(options);
14551455

14561456
if (options.endStream === undefined) {
14571457
// For some methods, we know that a payload is meaningless, so end the
@@ -1839,7 +1839,7 @@ class Http2Stream extends Duplex {
18391839

18401840
assertIsObject(options, 'options');
18411841
options = { ...options };
1842-
validatePriorityOptions(options);
1842+
setAndValidatePriorityOptions(options);
18431843

18441844
const priorityFn = submitPriority.bind(this, options);
18451845

0 commit comments

Comments
 (0)