File tree 1 file changed +8
-8
lines changed
1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -2942,14 +2942,14 @@ class QuicStream extends Duplex {
2942
2942
2943
2943
validateObject ( headers , 'headers' ) ;
2944
2944
2945
- // Push streams are only supported on QUIC servers, and
2946
- // only if the original stream is bidirectional.
2947
- // TODO(@jasnell): This is really an http/3 specific
2948
- // requirement so if we end up later with another
2949
- // QUIC application protocol that has a similar
2950
- // notion of push streams without this restriction,
2951
- // then we'll need to check alpn value here also.
2952
- if ( ! this . clientInitiated && ! this . bidirectional ) {
2945
+ // This is a small performance optimization for http/3,
2946
+ // where push streams are only supported for client
2947
+ // initiated, bidirectional streams. For any other alpn,
2948
+ // we'll make the attempt to push and handle the failure
2949
+ // after.
2950
+ if ( ! this . clientInitiated &&
2951
+ ! this . bidirectional &&
2952
+ this . session . alpnProtocol === 'h3-29' ) {
2953
2953
throw new ERR_INVALID_STATE (
2954
2954
'Push streams are only supported on client-initiated, ' +
2955
2955
'bidirectional streams' ) ;
You can’t perform that action at this time.
0 commit comments