Open Wonshtrum opened 1 year ago
fetch wasn't working in my scripts because the Buffer of the Response had no byteLength. I looked at the code and find out that the Rust Buffer struct exposes js_length as length attribute: https://github.com/second-state/wasmedge-quickjs/blob/2deecb889750c45b024be62637e6305aeb79190c/src/internal_module/httpx/js_module.rs#L160 but byteLength is used instead on the JS object: https://github.com/second-state/wasmedge-quickjs/blob/2deecb889750c45b024be62637e6305aeb79190c/modules/http.js#L114
fetch
Buffer
Response
byteLength
js_length
length
fetch
wasn't working in my scripts because theBuffer
of theResponse
had nobyteLength
. I looked at the code and find out that the RustBuffer
struct exposesjs_length
aslength
attribute: https://github.com/second-state/wasmedge-quickjs/blob/2deecb889750c45b024be62637e6305aeb79190c/src/internal_module/httpx/js_module.rs#L160 butbyteLength
is used instead on the JS object: https://github.com/second-state/wasmedge-quickjs/blob/2deecb889750c45b024be62637e6305aeb79190c/modules/http.js#L114