Hi, when using a custom io.ReadCloser nop as body with method POST, PUT, 
PATCH, TRACE or custom then (*http.Request).Write outputs a body of the 
form "0\r\n\r\n" (without the quotes). 
Proof-of-concept: https://play.golang.org/p/Rg2cZ0wihdd

Besides the fix, I think it would be useful to have body checked if it 
satisfies interface{ Len() int } or something similar (this would simplify 
code too by removing several type assertions, e.g., isKnownInMemoryReader 
func in net/http/transfer.go@go1.17.1) so that we can avoid chunked 
transfer encoding.

-- 
This email may contain material that is confidential for the sole use of 
the intended recipient(s).  Any review, reliance or distribution or 
disclosure by others without express permission is strictly prohibited.  If 
you are not the intended recipient, please contact the sender and delete 
all copies of this message.

-- 
You received this message because you are subscribed to the Google Groups 
"golang-nuts" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to golang-nuts+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/38b02a49-d408-478a-88c5-b4f99c358d1dn%40googlegroups.com.

Reply via email to