Skip to content

Commit

Permalink
quic: limit push check to http/3
Browse files Browse the repository at this point in the history
PR-URL: #34655
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
  • Loading branch information
jasnell committed Aug 17, 2020
1 parent 34165f0 commit 344c5e4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/internal/quic/core.js
Expand Up @@ -2942,14 +2942,14 @@ class QuicStream extends Duplex {

validateObject(headers, 'headers');

// Push streams are only supported on QUIC servers, and
// only if the original stream is bidirectional.
// TODO(@jasnell): This is really an http/3 specific
// requirement so if we end up later with another
// QUIC application protocol that has a similar
// notion of push streams without this restriction,
// then we'll need to check alpn value here also.
if (!this.clientInitiated && !this.bidirectional) {
// This is a small performance optimization for http/3,
// where push streams are only supported for client
// initiated, bidirectional streams. For any other alpn,
// we'll make the attempt to push and handle the failure
// after.
if (!this.clientInitiated &&
!this.bidirectional &&
this.session.alpnProtocol === 'h3-29') {
throw new ERR_INVALID_STATE(
'Push streams are only supported on client-initiated, ' +
'bidirectional streams');
Expand Down

0 comments on commit 344c5e4

Please sign in to comment.