I have a Koa application that has a multipart/form-data
file upload that has suddenly stopped working. I have spent over 8 hours now trying to isolate the issue. What I've tried/verified:
packages.json
; have tested against originally working versions of all relevant packages, and latest versions. Cookie
and Referer
, neither of which can be set in Postman). When debugging, the cleanest view of the problem is with formidable, in incoming_form.js
. A single data
event occurs:
Then an abort
event:
After that, the browser eventually times out. (The file is larger than the 15 bytes being received in the first data
event.)
I had hoped for a quick fix by switching from formidabl to busboy, and now I am a real bind, because this problem needs to get fixed, and I am running out of ways to look at the problem. I've tried to slice it every way I can think of, debug it every way I can think of, and short of writing my own multipart parser (not a task I would relish), I'm fast running out of options.
Has anyone run across this? Do you have any ideas how I might proceed with debugging or producing a minimum test case?
It turns out the issue was with koa-proxy : it doesn't correctly forward multipart POST requests. I fixed it by switching to koa-proxy2 , and I will look into contributing a fix to the koa-proxy project.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.