Closed etcd closed 5 months ago
I just noticed that there's a PR for this fix already: https://github.com/elysiajs/eden/pull/73. This issue can be closed once that's merged.
For anyone running into this issue, one simple workaround is to just use the original treaty client (edenTreaty
) as demonstrated above until this issue is fixed.
Can reproduce, even after #73 merged, running Eden 1.0.12
Fixed by #90 , can be closed.
The treaty2 client does not send files properly. The original treaty client works fine. Reproduction code:
The regression is due to these lines: https://github.com/elysiajs/eden/blob/dab2e53ac44539611b4545d3ee5ff937fa9f6b63/src/treaty2/index.ts#L235-L240
This condition runs because body is an object, and the line
fetchInit.body = JSON.stringify(fetchInit.body)
wipes out the file being uploaded.