]> Cypherpunks repositories - gostls13.git/commitdiff
http/internal: document final CRLF behavior on chunkedWriter
authorEric Daniels <eric@erdaniels.com>
Tue, 17 Jul 2018 00:49:55 +0000 (00:49 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Tue, 17 Jul 2018 02:23:17 +0000 (02:23 +0000)
Change-Id: I0f76b40dbfda2d382c88aec377db1851c4ac7441

Change-Id: I0f76b40dbfda2d382c88aec377db1851c4ac7441
GitHub-Last-Rev: ab42559278d8cba9e025b431a459d117500a73da
GitHub-Pull-Request: golang/go#26410
Reviewed-on: https://go-review.googlesource.com/124255
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/net/http/httputil/httputil.go
src/net/http/internal/chunked.go

index 2e523e9e269a6df7b02b79a95da1782ccd2e9268..09ea74d6d1f9e57c8a95620220e55040080fc8e2 100644 (file)
@@ -23,7 +23,9 @@ func NewChunkedReader(r io.Reader) io.Reader {
 
 // NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP
 // "chunked" format before writing them to w. Closing the returned chunkedWriter
-// sends the final 0-length chunk that marks the end of the stream.
+// sends the final 0-length chunk that marks the end of the stream but does
+// not send the final CRLF that appears after trailers; trailers and the last
+// CRLF must be written separately.
 //
 // NewChunkedWriter is not needed by normal applications. The http
 // package adds chunking automatically if handlers don't set a
index 63f321d03b957dfcbacafc39acfc972d33e1eb4f..f06e5725f3477988281ef10ae078cd945083a428 100644 (file)
@@ -171,7 +171,9 @@ func removeChunkExtension(p []byte) ([]byte, error) {
 
 // NewChunkedWriter returns a new chunkedWriter that translates writes into HTTP
 // "chunked" format before writing them to w. Closing the returned chunkedWriter
-// sends the final 0-length chunk that marks the end of the stream.
+// sends the final 0-length chunk that marks the end of the stream but does
+// not send the final CRLF that appears after trailers; trailers and the last
+// CRLF must be written separately.
 //
 // NewChunkedWriter is not needed by normal applications. The http
 // package adds chunking automatically if handlers don't set a