[go: nahoru, domu]

Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fetch Fixes #49

Closed
wants to merge 25 commits into from
Closed

Fetch Fixes #49

wants to merge 25 commits into from

Conversation

nicoburniske
Copy link
@nicoburniske nicoburniske commented May 20, 2024

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.

@guybedford
Copy link
Contributor

It looks like #52 may now resolve this I believe.

@tschneidereit
Copy link
Member

Hi @nicoburniske, as Guy said, #52, which I've been working on for quite a while, should address these same issues, plus a whole host of others. my apologies for not highlighting that work more thoroughly earlier, and hence causing you to do a bunch of duplicate work :(

@nicoburniske
Copy link
Author

@tschneidereit No problem whatsoever. I'm just happy it's being addressed! Thanks for all of your hard work on this

@nicoburniske
Copy link
Author

Closing in favor of #52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Error when sending POST requests with fetch
4 participants