StarlingMonkey
StarlingMonkey copied to clipboard
Fetch Fixes
Closes #10, #19
Fix GET and POST request bugs:
- GET: Remove lock check in code path where body is previously locked to resolve body disturbed error
- POST: Cache WASI HTTP headers in
HttpOutgoingRequest
and close body inwrite_all
case
Note: Async body in POST requests is not supported. This means when you make a fetch request and pass the response body directly into another fetch request without awaiting it first, like:
const response1 = await fetch(url1);
const response2 = await fetch(url2, { method: 'POST', body: response1.body });
This limitation should be documented and addressed separately from the fixes in this PR.