diff options
author | James M Snell <jasnell@gmail.com> | 2020-08-07 03:04:24 +0300 |
---|---|---|
committer | James M Snell <jasnell@gmail.com> | 2020-08-17 21:23:28 +0300 |
commit | 344c5e4e508ee6c7fad98bb5a34daa98ff43df68 (patch) | |
tree | 665ed09d6d44cfd47b7096bf2256fde51fe01aca /lib/internal/quic | |
parent | 34165f03aa33d58c1a4fbbad0b2c3306a97b0657 (diff) |
quic: limit push check to http/3
PR-URL: https://github.com/nodejs/node/pull/34655
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Rich Trott <rtrott@gmail.com>
Diffstat (limited to 'lib/internal/quic')
-rw-r--r-- | lib/internal/quic/core.js | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/internal/quic/core.js b/lib/internal/quic/core.js index 0730303a134..d311852d950 100644 --- a/lib/internal/quic/core.js +++ b/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'); |