MCPcopy
hub / github.com/nodejs/undici / #validatePayloadLength

Method #validatePayloadLength

lib/web/websocket/receiver.js:78–89  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

76 }
77
78 #validatePayloadLength () {
79 if (
80 this.#maxPayloadSize > 0 &&
81 !isControlFrame(this.#info.opcode) &&
82 this.#info.payloadLength + this.#fragmentsBytes > this.#maxPayloadSize
83 ) {
84 failWebsocketConnection(this.#handler, 1009, 'Payload size exceeds maximum allowed size')
85 return false
86 }
87
88 return true
89 }
90
91 /**
92 * Runs whenever a new chunk is received.

Callers 1

runMethod · 0.95

Calls 2

isControlFrameFunction · 0.85
failWebsocketConnectionFunction · 0.85

Tested by

no test coverage detected