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/httputil: DumpRequestOut(req, false) fails if req.Body != nil #6471

Closed
gopherbot opened this issue Sep 24, 2013 · 4 comments
Closed
Milestone

Comments

@gopherbot
Copy link

by sdefresne:

The httputil.DumpRequestOut second parameter control whether it should dump the request
body or not. However, if the request contains a body, and second parameter is false,
then the function fails with error: "http: Request.ContentLength=%d with nil
Body".

This can be checked here:
http://play.golang.org/p/UiU6kwcEox

I guess this is because the implementation does use a real Transport to send the request
to a fake server and record it.
@rsc
Copy link
Contributor

rsc commented Oct 18, 2013

Comment 1:

Okay to fix if it's trivial.

Labels changed: added priority-later, go1.2maybe, removed priority-triage.

Status changed to Accepted.

@bradfitz
Copy link
Contributor

Comment 2:

Sure... https://golang.org/cl/14920050

Owner changed to @bradfitz.

Status changed to Started.

@bradfitz
Copy link
Contributor

Comment 3:

This issue was closed by revision 1428045.

Status changed to Fixed.

@adg
Copy link
Contributor

adg commented Nov 1, 2013

Comment 4:

This issue was closed by revision 01bdd721c137.

@rsc rsc added this to the Go1.2 milestone Apr 14, 2015
@rsc rsc removed the go1.2maybe label Apr 14, 2015
adg added a commit that referenced this issue May 11, 2015
…tentLength & false body param

««« CL 14920050 / 5ed8c82778ae
net/http/httputil: fix DumpRequestOut with ContentLength & false body param

Fixes #6471

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/14920050
»»»

R=golang-dev
CC=golang-dev
https://golang.org/cl/20590044
@golang golang locked and limited conversation to collaborators Jun 25, 2016
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants