@@ -2165,10 +2165,7 @@ class QuicStream { |
2165 | 2165 | sendHeaders(headers, options = kEmptyObject) { |
2166 | 2166 | assertIsQuicStream(this); |
2167 | 2167 | if (this.destroyed) return false; |
2168 | | - if (getQuicSessionState(this.#inner.session).headersSupported === 2) { |
2169 | | - throw new ERR_INVALID_STATE( |
2170 | | - 'The negotiated QUIC application protocol does not support headers'); |
2171 | | - } |
| 2168 | + assertHeadersSupported(this.#inner.session); |
2172 | 2169 | validateObject(headers, 'headers'); |
2173 | 2170 | const { terminal = false } = options; |
2174 | 2171 | const headerString = buildNgHeaderString( |
@@ -2187,10 +2184,7 @@ class QuicStream { |
2187 | 2184 | sendInformationalHeaders(headers) { |
2188 | 2185 | assertIsQuicStream(this); |
2189 | 2186 | if (this.destroyed) return false; |
2190 | | - if (getQuicSessionState(this.#inner.session).headersSupported === 2) { |
2191 | | - throw new ERR_INVALID_STATE( |
2192 | | - 'The negotiated QUIC application protocol does not support headers'); |
2193 | | - } |
| 2187 | + assertHeadersSupported(this.#inner.session); |
2194 | 2188 | validateObject(headers, 'headers'); |
2195 | 2189 | const headerString = buildNgHeaderString( |
2196 | 2190 | headers, assertValidPseudoHeader, true); |
@@ -2208,10 +2202,7 @@ class QuicStream { |
2208 | 2202 | sendTrailers(headers) { |
2209 | 2203 | assertIsQuicStream(this); |
2210 | 2204 | if (this.destroyed) return false; |
2211 | | - if (getQuicSessionState(this.#inner.session).headersSupported === 2) { |
2212 | | - throw new ERR_INVALID_STATE( |
2213 | | - 'The negotiated QUIC application protocol does not support headers'); |
2214 | | - } |
| 2205 | + assertHeadersSupported(this.#inner.session); |
2215 | 2206 | validateObject(headers, 'headers'); |
2216 | 2207 | const headerString = buildNgHeaderString(headers); |
2217 | 2208 | return sendHeaders( |
@@ -2683,10 +2674,7 @@ class QuicStream { |
2683 | 2674 | [kSendHeaders](headers, kind = kHeadersKindInitial, |
2684 | 2675 | flags = kHeadersFlagsTerminal) { |
2685 | 2676 | validateObject(headers, 'headers'); |
2686 | | - if (getQuicSessionState(this.#inner.session).headersSupported === 2) { |
2687 | | - throw new ERR_INVALID_STATE( |
2688 | | - 'The negotiated QUIC application protocol does not support headers'); |
2689 | | - } |
| 2677 | + assertHeadersSupported(this.#inner.session); |
2690 | 2678 | if (this.pending) { |
2691 | 2679 | debug('pending stream enqueuing headers', headers); |
2692 | 2680 | } else { |
|