File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -976,7 +976,13 @@ class Http2Session extends EventEmitter {
976
976
if ( socket . connecting ) {
977
977
const connectEvent =
978
978
socket instanceof tls . TLSSocket ? 'secureConnect' : 'connect' ;
979
- socket . once ( connectEvent , setupFn ) ;
979
+ socket . once ( connectEvent , ( ) => {
980
+ try {
981
+ setupFn ( ) ;
982
+ } catch ( error ) {
983
+ socket . destroy ( error ) ;
984
+ }
985
+ } ) ;
980
986
} else {
981
987
setupFn ( ) ;
982
988
}
Original file line number Diff line number Diff line change @@ -69,6 +69,20 @@ const { connect: netConnect } = require('net');
69
69
connect ( authority ) . on ( 'error' , ( ) => { } ) ;
70
70
}
71
71
72
+ // Check for error for init settings error
73
+ {
74
+ createServer ( function ( ) {
75
+ connect ( `http://localhost:${ this . address ( ) . port } ` , {
76
+ settings : {
77
+ maxFrameSize : 1 // An incorrect settings
78
+ }
79
+ } ) . on ( 'error' , expectsError ( {
80
+ code : 'ERR_HTTP2_INVALID_SETTING_VALUE' ,
81
+ type : RangeError
82
+ } ) ) ;
83
+ } ) ;
84
+ }
85
+
72
86
// Check for error for an invalid protocol (not http or https)
73
87
{
74
88
const authority = 'ssh://localhost' ;
You can’t perform that action at this time.
0 commit comments