Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(uws): properly handle chunked content
On Safari, a POST request would result in two chunks (the first being empty), and threw the following error: > node:buffer:254 > TypedArrayPrototypeSet(target, source, targetStart); > ^ > > TypeError: Cannot perform %TypedArray%.prototype.set on a detached ArrayBuffer > at Buffer.set (<anonymous>) > at _copyActual (node:buffer:254:3) > at Function.concat (node:buffer:562:12) > at onEnd (xxx/node_modules/engine.io/build/transports-uws/polling.js:126:32) > at xxx/node_modules/engine.io/build/transports-uws/polling.js:143:17 Which is a bit weird, because it seems µWebSockets.js does not support chunked content: uNetworking/uWebSockets.js#669
- Loading branch information
d970d66
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your test does not test this issue. This issue is triggered for POST's with data above a certain size, like 200KB will trigger multiple "chunks" of onData callbacks and will cause issue. This has NOTHING to do with
transfer-encoding: chunked
protocol which just happens to have "chunked" in the name, they are 2 different things. If you are still confused please ask for clarification, because currently you don't understand