Skip to content

Commit 1862305

Browse files
committed
quic: fix error message on invalid connection ID
If Buffer.from() throws, it does not return a value, so the error message is always going to report `undefined`. Use the value passed to Buffer.from() instead. PR-URL: #35026 Reviewed-By: Jiawen Geng <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent f3b4846 commit 1862305

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/internal/quic/util.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -405,11 +405,11 @@ function validateQuicClientSessionOptions(options = {}) {
405405
if (typeof dcid_value === 'string') {
406406
// If it's a string, it must be a hex encoded string
407407
try {
408-
dcid = Buffer.from(dcid_value, 'hex');
408+
Buffer.from(dcid_value, 'hex');
409409
} catch {
410410
throw new ERR_INVALID_ARG_VALUE(
411411
'options.dcid',
412-
dcid,
412+
dcid_value,
413413
'is not a valid QUIC connection ID');
414414
}
415415
}

0 commit comments

Comments
 (0)