Sitelet https://web.archive.org/web/20220419104751/https://github.com/nodejs/node/commit/344c5e4e50
Skip to content
Permalink
Browse files
quic: limit push check to http/3
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 344c5e4e508ee6c7fad98bb5a34daa98ff43df68
Showing with 8 additions and 8 deletions.
  1. +8 −8 lib/internal/quic/core.js
@@ -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');

0 comments on commit 344c5e4

Please sign in to comment.