@@ -881,14 +881,14 @@ class Http2Session extends EventEmitter {
881
881
882
882
// A stream cannot be made to depend on itself
883
883
if ( options . parent === id ) {
884
- debug ( `[${ sessionName ( this [ kType ] ) } ] session still connecting. queue ` +
885
- 'priority' ) ;
886
884
throw new errors . TypeError ( 'ERR_INVALID_OPT_VALUE' ,
887
885
'parent' ,
888
886
options . parent ) ;
889
887
}
890
888
891
889
if ( id === undefined ) {
890
+ debug ( `[${ sessionName ( this [ kType ] ) } ] session still connecting. queue ` +
891
+ 'priority' ) ;
892
892
stream . once ( 'ready' , submitPriority . bind ( this , stream , options ) ) ;
893
893
return ;
894
894
}
@@ -1203,7 +1203,7 @@ function streamOnResume() {
1203
1203
if ( session && ! state . reading ) {
1204
1204
state . reading = true ;
1205
1205
assert ( session [ kHandle ] . streamReadStart ( this [ kID ] ) === undefined ,
1206
- ' HTTP/2 Stream # {this[kID]} does not exist. Please report this as ' +
1206
+ ` HTTP/2 Stream $ {this [ kID ] } does not exist. Please report this as ` +
1207
1207
'a bug in Node.js' ) ;
1208
1208
}
1209
1209
}
@@ -1411,7 +1411,7 @@ class Http2Stream extends Duplex {
1411
1411
return ;
1412
1412
state . reading = true ;
1413
1413
assert ( this [ kSession ] [ kHandle ] . streamReadStart ( this [ kID ] ) === undefined ,
1414
- ' HTTP/2 Stream # {this[kID]} does not exist. Please report this as ' +
1414
+ ` HTTP/2 Stream $ {this [ kID ] } does not exist. Please report this as ` +
1415
1415
'a bug in Node.js' ) ;
1416
1416
}
1417
1417
@@ -2264,16 +2264,14 @@ function connectionListener(socket) {
2264
2264
const options = this [ kOptions ] || { } ;
2265
2265
2266
2266
if ( socket . alpnProtocol === false || socket . alpnProtocol === 'http/1.1' ) {
2267
- if ( options . allowHTTP1 === true ) {
2268
- // Fallback to HTTP/1.1
2267
+ // Fallback to HTTP/1.1
2268
+ if ( options . allowHTTP1 === true )
2269
2269
return httpConnectionListener . call ( this , socket ) ;
2270
- } else if ( this . emit ( 'unknownProtocol' , socket ) ) {
2271
- // Let event handler deal with the socket
2270
+ // Let event handler deal with the socket
2271
+ if ( this . emit ( 'unknownProtocol' , socket ) )
2272
2272
return ;
2273
- } else {
2274
- // Reject non-HTTP/2 client
2275
- return socket . destroy ( ) ;
2276
- }
2273
+ // Reject non-HTTP/2 client
2274
+ return socket . destroy ( ) ;
2277
2275
}
2278
2276
2279
2277
socket . on ( 'error' , socketOnError ) ;
0 commit comments