* @param {object} headers * @param {SendHeadersOptions} [options] * @returns {boolean}
(headers, options = kEmptyObject)
| 2053 | * @returns {boolean} |
| 2054 | */ |
| 2055 | sendHeaders(headers, options = kEmptyObject) { |
| 2056 | assertIsQuicStream(this); |
| 2057 | if (this.destroyed) return false; |
| 2058 | if (getQuicSessionState(this.#inner.session).headersSupported === 2) { |
| 2059 | throw new ERR_INVALID_STATE( |
| 2060 | 'The negotiated QUIC application protocol does not support headers'); |
| 2061 | } |
| 2062 | validateObject(headers, 'headers'); |
| 2063 | const { terminal = false } = options; |
| 2064 | const headerString = buildNgHeaderString( |
| 2065 | headers, assertValidPseudoHeader, true /* strictSingleValueFields */); |
| 2066 | const flags = terminal ? kHeadersFlagsTerminal : kHeadersFlagsNone; |
| 2067 | return this.#handle.sendHeaders(kHeadersKindInitial, headerString, flags); |
| 2068 | } |
| 2069 | |
| 2070 | /** |
| 2071 | * Send informational (1xx) headers on this stream. Server only. |
no test coverage detected