MCPcopy Index your code
hub / github.com/nodejs/node / sendHeaders

Method sendHeaders

lib/internal/quic/quic.js:2055–2068  ·  view source on GitHub ↗

* @param {object} headers * @param {SendHeadersOptions} [options] * @returns {boolean}

(headers, options = kEmptyObject)

Source from the content-addressed store, hash-verified

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.

Calls 1

buildNgHeaderStringFunction · 0.85

Tested by

no test coverage detected