net/http: support streaming request body in wasm #68698
Labels
arch-wasm
WebAssembly issues
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
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.
The text was updated successfully, but these errors were encountered: