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

Function validatePreparedResponseHeaders

lib/internal/http2/core.js:2677–2690  ·  view source on GitHub ↗
(headers, statusCode)

Source from the content-addressed store, hash-verified

2675}
2676
2677function validatePreparedResponseHeaders(headers, statusCode) {
2678 // This is intentionally stricter than the HTTP/1 implementation, which
2679 // allows values between 100 and 999 (inclusive) in order to allow for
2680 // backwards compatibility with non-spec compliant code. With HTTP/2,
2681 // we have the opportunity to start fresh with stricter spec compliance.
2682 // This will have an impact on the compatibility layer for anyone using
2683 // non-standard, non-compliant status codes.
2684 if (statusCode < 200 || statusCode > 599)
2685 throw new ERR_HTTP2_STATUS_INVALID(statusCode);
2686
2687 const neverIndex = headers[kSensitiveHeaders];
2688 if (neverIndex !== undefined && !ArrayIsArray(neverIndex))
2689 throw new ERR_INVALID_ARG_VALUE('headers[http2.neverIndex]', neverIndex);
2690}
2691
2692function onFileUnpipe() {
2693 const stream = this.sink[kOwner];

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…