Oh, thanks for clarifying that. But still, even if transfer encoding will be chunked, I don't see why it would make up a body of "0\r\n\r\n" if the nop body wouldn't give away any bytes at all.
On Friday, September 17, 2021 at 7:56:21 AM UTC-3 seank...@gmail.com wrote: > This was an intentional change in 1.8 > https://github.com/golang/go/issues/20257#issuecomment-299509391 > > On Friday, September 17, 2021 at 6:45:13 AM UTC+2 dmo...@synack.com wrote: > >> 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/trans...@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. >> > -- 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/3b9df959-99e0-418f-9f98-35bf62e7b6b7n%40googlegroups.com.