Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 4 additions & 16 deletions lib/internal/quic/quic.js
Original file line number Diff line number Diff line change
Expand Up @@ -2160,10 +2160,7 @@ class QuicStream {
sendHeaders(headers, options = kEmptyObject) {
assertIsQuicStream(this);
if (this.destroyed) return false;
if (getQuicSessionState(this.#inner.session).headersSupported === 2) {
throw new ERR_INVALID_STATE(
'The negotiated QUIC application protocol does not support headers');
}
assertHeadersSupported(this.#inner.session);
validateObject(headers, 'headers');
const { terminal = false } = options;
const headerString = buildNgHeaderString(
Expand All @@ -2182,10 +2179,7 @@ class QuicStream {
sendInformationalHeaders(headers) {
assertIsQuicStream(this);
if (this.destroyed) return false;
if (getQuicSessionState(this.#inner.session).headersSupported === 2) {
throw new ERR_INVALID_STATE(
'The negotiated QUIC application protocol does not support headers');
}
assertHeadersSupported(this.#inner.session);
validateObject(headers, 'headers');
const headerString = buildNgHeaderString(
headers, assertValidPseudoHeader, true);
Expand All @@ -2203,10 +2197,7 @@ class QuicStream {
sendTrailers(headers) {
assertIsQuicStream(this);
if (this.destroyed) return false;
if (getQuicSessionState(this.#inner.session).headersSupported === 2) {
throw new ERR_INVALID_STATE(
'The negotiated QUIC application protocol does not support headers');
}
assertHeadersSupported(this.#inner.session);
validateObject(headers, 'headers');
const headerString = buildNgHeaderString(headers);
return sendHeaders(
Expand Down Expand Up @@ -2678,10 +2669,7 @@ class QuicStream {
[kSendHeaders](headers, kind = kHeadersKindInitial,
flags = kHeadersFlagsTerminal) {
validateObject(headers, 'headers');
if (getQuicSessionState(this.#inner.session).headersSupported === 2) {
throw new ERR_INVALID_STATE(
'The negotiated QUIC application protocol does not support headers');
}
assertHeadersSupported(this.#inner.session);
if (this.pending) {
debug('pending stream enqueuing headers', headers);
} else {
Expand Down
Loading