diff --git a/src/net/http/request.go b/src/net/http/request.go index ea2d51fee5..390f3cc063 100644 --- a/src/net/http/request.go +++ b/src/net/http/request.go @@ -321,8 +321,7 @@ type Request struct { // // For incoming server requests, the context is canceled when the // client's connection closes, the request is canceled (with HTTP/2), -// the ServeHTTP method returns, or if the Hijack method is -// called on the ResponseWriter. +// or when the ServeHTTP method returns. func (r *Request) Context() context.Context { if r.ctx != nil { return r.ctx diff --git a/src/net/http/server.go b/src/net/http/server.go index d54b745cd2..e8903c5346 100644 --- a/src/net/http/server.go +++ b/src/net/http/server.go @@ -190,7 +190,9 @@ type Hijacker interface { // data from the client. // // After a call to Hijack, the original Request.Body must not - // be used, and the Request.Context will be canceled. + // be used. The original Request's Context remains valid and + // is not canceled until the Request's ServeHTTP method + // returns. Hijack() (net.Conn, *bufio.ReadWriter, error) }