StarlingMonkey icon indicating copy to clipboard operation
StarlingMonkey copied to clipboard

Fetch Fixes

Open nicoburniske opened this issue 9 months ago • 0 comments

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 in write_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.

nicoburniske avatar May 20 '24 12:05 nicoburniske