From 18227bb7b6ce14c2736543777f1d5cebeff11abd Mon Sep 17 00:00:00 2001 From: Brad Fitzpatrick Date: Thu, 17 Dec 2015 19:36:43 +0000 Subject: net/http: be more consistent about Request.Method "" vs "GET" Patch from Russ. No bug identified, but I didn't search exhaustively. The new code is easier to read. Fixes #13621 Change-Id: Ifda936e4101116fa254ead950b5fe06adb14e977 Reviewed-on: https://go-review.googlesource.com/17981 Reviewed-by: Brad Fitzpatrick Run-TryBot: Brad Fitzpatrick TryBot-Result: Gobot Gobot Reviewed-by: Russ Cox --- src/net/http/transfer.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/net/http/transfer.go') diff --git a/src/net/http/transfer.go b/src/net/http/transfer.go index b452f33ad6..480226af82 100644 --- a/src/net/http/transfer.go +++ b/src/net/http/transfer.go @@ -56,7 +56,7 @@ func newTransferWriter(r interface{}) (t *transferWriter, err error) { if rr.ContentLength != 0 && rr.Body == nil { return nil, fmt.Errorf("http: Request.ContentLength=%d with nil Body", rr.ContentLength) } - t.Method = rr.Method + t.Method = valueOrDefault(rr.Method, "GET") t.Body = rr.Body t.BodyCloser = rr.Body t.ContentLength = rr.ContentLength -- cgit v1.3-6-g1900