]> Cypherpunks.ru repositories - gostls13.git/commit
net/http: avoid setting body when NoBody is set for js/wasm
authorAgniva De Sarker <agnivade@yahoo.co.in>
Sat, 13 Jun 2020 05:07:22 +0000 (10:37 +0530)
committerAgniva De Sarker <agniva.quicksilver@gmail.com>
Sat, 15 Aug 2020 15:29:33 +0000 (15:29 +0000)
commitb6ad2880323191713a5525bae5eb27d62c1d1c35
treedad91239e13ea04d1d66f163b6a338c8f14d2a14
parentccc951637be806e6e7a3c2c922bf4746b60e7395
net/http: avoid setting body when NoBody is set for js/wasm

When http.NoBody is set, it is equivalent to Body being zero bytes.
We therefore set the body only if it is of length greater than 0.

Manually verified with wasmbrowsertest.

Fixes #36339

Change-Id: I9c108c38f99409f72ea101819af572429505a8ad
Reviewed-on: https://go-review.googlesource.com/c/go/+/237758
Run-TryBot: Agniva De Sarker <agniva.quicksilver@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Johan Brandhorst <johan.brandhorst@gmail.com>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/net/http/roundtrip_js.go