You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Fast-abort body size limit loses original error and may hang consumers #186
When processDecompressedChunk hits maxBodySize in fastAbort mode, the stream is never explicitly destroyed. It relies on uwsRes.close() eventually triggering the _onAbort callback, which:
Overwrites the original 'Body size limit exceeded' error with 'Connection aborted'
May leave awaiting consumers hanging briefly until the abort callback fires
Expected Behavior
req.buffer() / req.json() / req.text() should reject with Error: Body size limit exceeded even in fastAbort mode
The stream should be destroyed immediately with the correct error
Actual Behavior
The original error is lost because _onAbort unconditionally sets this.abortError = new Error('Connection aborted')
In test mocks (where close() does not trigger onAborted), the promise hangs forever
Proposed Fix
In the else (fast-abort) branch, explicitly call this.destroy(this.abortError) so the error is preserved and consumers are unblocked immediately
In the _onAbort callback, only set this.abortError if it isn't already set:
Activity