Skip to content

net/http/httputil: DumpRequestOut(req, false) fails if req.Body != nil #6471

@gopherbot

Description

@gopherbot

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions