mirror of
https://github.com/nlepage/go-wasm-http-server.git
synced 2025-03-10 17:29:10 +00:00
🐛
This commit is contained in:
parent
74999fa92e
commit
ce9bfc89b8
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)
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user