This commit is contained in:
Nicolas Lepage 2021-01-24 21:32:34 +01:00
parent 74999fa92e
commit ce9bfc89b8
No known key found for this signature in database
GPG Key ID: B0879E35E66D8F6F
3 changed files with 1 additions and 1 deletions

Binary file not shown.

Binary file not shown.

View File

@ -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)
}