Open mihaiav opened 4 months ago
Related Issues and Documentation
(Emoji vote if this was helpful or unhelpful; more detailed feedback welcome in this discussion.)
this was previously implemented as CL 458395 and reverted for #61889
CC @golang/wasm
Go version
go1.22.5 darwin/arm64
Output of
go env
in your module/workspace:What did you do?
I've tried to upload a large file (1.2 GB) to a remote server. Obviously I've posted the body as an io.Reader.
What did you see happen?
I've got an out of memory error:
runtime: out of memory: cannot allocate 918552576-byte block (3715989504 in use) [wasm_exec.js:22:14](https://hopz.com/static/wasm/wasm_exec.js) fatal error: out of memory
After some investigation I've found this line which seems to read the whole body before posting it. https://github.com/golang/go/blob/master/src/net/http/roundtrip_js.go#L116
What did you expect to see?
I expected to be able to post large file using the io.Reader supported by the net/http package.