net/http/httputil: DumpResponse return error when ContentLength=2 with Body length 0, but it's a response for http.MethodHead request #42478
What version of Go are you using (
The text was updated successfully, but these errors were encountered:
It's not clear to me what you're trying to convey.
What did you expect to see?
--- FAIL: TestDumpResponse (0.00s) --- FAIL: TestDumpResponse/Head (0.00s) main_test.go:38: DumpResponse: (http: ContentLength=2 with Body length 0) Raw: FAIL FAIL command-line-arguments 0.003s FAIL
What did you see instead?
But if I run the tests myself I obtain the exact opposite result. I guess you meant to say that you expected "ok" and got the error instead.
Assuming my guess is right, your bug is saying that
Why did you expect httputil to work on inconsistent responses?