]> Cypherpunks repositories - gostls13.git/commitdiff
net/http: document that after Hijack, Request.Body is invalid
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 21 Jul 2017 18:52:38 +0000 (18:52 +0000)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 21 Jul 2017 18:55:41 +0000 (18:55 +0000)
We can make it panic with a more explicit and readable error message
during Go 1.10, but document it for now. This has always been the
case; it's not a new rule.

Updates #20933

Change-Id: I53c1fefb47a8f4aae0bb32fa742afa3a2ed20e8a
Reviewed-on: https://go-review.googlesource.com/50634
Reviewed-by: Ian Lance Taylor <iant@golang.org>
Reviewed-by: Emmanuel Odeke <emm.odeke@gmail.com>
src/net/http/server.go

index a2c3acef50c0a51de0be279a9dd812ec3031c04e..2fa8ab23d8a10ffa4153d61ef82651c07b492b55 100644 (file)
@@ -178,6 +178,9 @@ type Hijacker interface {
        //
        // The returned bufio.Reader may contain unprocessed buffered
        // data from the client.
+       //
+       // After a call to Hijack, the original Request.Body should
+       // not be used.
        Hijack() (net.Conn, *bufio.ReadWriter, error)
 }