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

net/http: Fetch API-based Transport panics when request has no body #60809

Closed
dmitshur opened this issue Jun 15, 2023 · 1 comment
Closed

net/http: Fetch API-based Transport panics when request has no body #60809

dmitshur opened this issue Jun 15, 2023 · 1 comment
Labels
arch-wasm WebAssembly issues NeedsFix The path to resolution is known, but the work has not been done. OS-JS
Milestone

Comments

@dmitshur
Copy link
Contributor

The req.Body.Close() calls were refactored in CL 458395 to happen in the success/failure callbacks. The original location was inside an if req.Body != nil block, but the new location missed that check, causing Transport.RoundTrip to panic whenever the request doesn't have a body.

CC @golang/js, @golang/wasm.

@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. arch-wasm WebAssembly issues OS-JS labels Jun 15, 2023
@dmitshur dmitshur added this to the Go1.21 milestone Jun 15, 2023
@gopherbot
Copy link

Change https://go.dev/cl/503676 mentions this issue: net/http: close req.Body only when it's non-nil on js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
arch-wasm WebAssembly issues NeedsFix The path to resolution is known, but the work has not been done. OS-JS
Projects
None yet
Development

No branches or pull requests

2 participants