]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: ignore CloseNotify when a non-background context is present
authorDamien Neil <dneil@google.com>
Fri, 7 Jan 2022 18:11:08 +0000 (10:11 -0800)
committerDamien Neil <dneil@google.com>
Thu, 24 Mar 2022 21:51:49 +0000 (21:51 +0000)
commita10a209b23f877c80d8a5f3ebda1ce4b492ac3a9
tree69932581eaa4f059a4107af15f6e5f5714204e17
parentb88600f926b6a1fb6de6e3a8cc1f0db9132bddb4
net/http/httputil: ignore CloseNotify when a non-background context is present

If the http.Request passed to ReverseProxy.ServeHTTP has a context
with a non-nil Done channel, don't watch the ResponseWriter's
CloseNotify channel.

Avoids starting an extra background goroutine in the common case.

Change-Id: I1328f3e02d3025caa0f446a2f20dfc14ef604c64
Reviewed-on: https://go-review.googlesource.com/c/go/+/376415
Trust: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Trust: Damien Neil <dneil@google.com>
src/net/http/httputil/reverseproxy.go