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/cgi: Serve function passes a *http.Request value with a nil Body #39190

Closed
gazerro opened this issue May 21, 2020 · 4 comments
Closed
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Milestone

Comments

@gazerro
Copy link
Contributor

gazerro commented May 21, 2020

The cgi.Serve function passes to the http.Handler a *http.Request value with a nil Body field when the request "Content-Length" header is not greater than zero.

But the documentation of Request.Body states:

// For server requests, the Request Body is always non-nil

As a conseguence, if the http.Handler calls the Request.ParseForm method a "missing form body" panic occurs.

@cagedmantis cagedmantis added the NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. label May 21, 2020
@cagedmantis cagedmantis added this to the Backlog milestone May 21, 2020
@cagedmantis
Copy link
Contributor

/cc @bradfitz @bcmills

@bcmills
Copy link
Contributor

bcmills commented May 21, 2020

Want to send a CL for when the tree opens for Go 1.16? (A regression test using httptest.Server seems straightforward.)

@gazerro
Copy link
Contributor Author

gazerro commented May 22, 2020

@bcmills Yes, I will send a CL with a regression test.

@gopherbot
Copy link

Change https://golang.org/cl/235137 mentions this issue: net/http/cgi: don't pass nil Body to the child handler

@bcmills bcmills modified the milestones: Backlog, Go1.16 Sep 1, 2020
@dmitshur dmitshur added NeedsFix The path to resolution is known, but the work has not been done. and removed NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. labels Sep 1, 2020
@golang golang locked and limited conversation to collaborators Sep 1, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge help wanted NeedsFix The path to resolution is known, but the work has not been done.
Projects
None yet
Development

No branches or pull requests

5 participants