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

Method sendTrailers

lib/internal/quic/quic.js:2097–2108  ·  view source on GitHub ↗

* Send trailing headers on this stream. Must be called synchronously * during the onwanttrailers callback, or set via pendingTrailers before * the body completes. Throws if the application does not support headers. * @param {object} headers * @returns {boolean}

(headers)

Source from the content-addressed store, hash-verified

2095 * @returns {boolean}
2096 */
2097 sendTrailers(headers) {
2098 assertIsQuicStream(this);
2099 if (this.destroyed) return false;
2100 if (getQuicSessionState(this.#inner.session).headersSupported === 2) {
2101 throw new ERR_INVALID_STATE(
2102 'The negotiated QUIC application protocol does not support headers');
2103 }
2104 validateObject(headers, 'headers');
2105 const headerString = buildNgHeaderString(headers);
2106 return this.#handle.sendHeaders(
2107 kHeadersKindTrailing, headerString, kHeadersFlagsNone);
2108 }
2109
2110 /**
2111 * Returns a Writer for pushing data to this stream incrementally.

Calls 2

buildNgHeaderStringFunction · 0.85
sendHeadersMethod · 0.80

Tested by

no test coverage detected