Malformed multipart/form-data upload - koa
servers are unable to process it
#11759
Labels
Resolution: Locked
This issue was locked by the bot.
I'm going to close this immediately, since I haven't conclusively isolated this to React Native, but figured I should document it in case someone else hits this behavior.
There seems to be some sort of incompatibility between the
multipart/form-data
request generated by React Native's XHR andfetch
implementations, and the request body expected by all thekoa
middleware's I've tested (koa-body
,koa-better-body
,koa-multer
). This causes the server to silently fail to parse the body, about 50-75% of the time.It doesn't seem to be a race condition or similar — replaying the same requests will deterministically either succeed or fail, depending on the request body.
Here's a request that fails:
headers
body
And one that succeeds:
headers
body
The only client I found that caused this specific failure mode was the JavaScript XHR / fetch API in React Native. I haven't figured out whether the misbehavior here is on the client or server, but I've managed to avoid it by switching my client to use RNFetchBlob instead.
Cross-post: koajs/koa-body#45
The text was updated successfully, but these errors were encountered: