mirror of
https://github.com/nlepage/go-wasm-http-server.git
synced 2026-01-12 01:59:14 +00:00
🐛
This commit is contained in:
Binary file not shown.
Binary file not shown.
@@ -37,11 +37,11 @@ func (rr ResponseRecorder) JSValue() js.Value {
|
||||
|
||||
var body js.Value = js.Undefined()
|
||||
if res.ContentLength != 0 {
|
||||
body = js.Global().Get("Uint8Array").New(res.ContentLength)
|
||||
var b, err = ioutil.ReadAll(res.Body)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
body = js.Global().Get("Uint8Array").New(len(b))
|
||||
js.CopyBytesToJS(body, b)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user