MCPcopy
hub / github.com/nodejs/undici / isValidStatusCode

Function isValidStatusCode

lib/web/websocket/util.js:148–158  ·  view source on GitHub ↗

* @see https://datatracker.ietf.org/doc/html/rfc6455#section-7-4 * @param {number} code * @returns {boolean}

(code)

Source from the content-addressed store, hash-verified

146 * @returns {boolean}
147 */
148function isValidStatusCode (code) {
149 if (code >= 1000 && code < 1015) {
150 return (
151 code !== 1004 && // reserved
152 code !== 1005 && // "MUST NOT be set as a status code"
153 code !== 1006 // "MUST NOT be set as a status code"
154 )
155 }
156
157 return code >= 3000 && code <= 4999
158}
159
160/**
161 * @see https://datatracker.ietf.org/doc/html/rfc6455#section-5.5

Callers 1

parseCloseBodyMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…