]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: don't call WriteHeader after Hijack
authorDamien Neil <dneil@google.com>
Wed, 19 Mar 2025 16:26:31 +0000 (09:26 -0700)
committerGopher Robot <gobot@golang.org>
Wed, 19 Mar 2025 16:57:03 +0000 (09:57 -0700)
commit1aa9c31ffc8af3fd33bfa995ecf55f08daf33f81
treedb6da85a2ac2271c0642040f77b7debc198cf406
parentdeb6790fcfe943c640a4ef393036690eef5eef5c
net/http/httputil: don't call WriteHeader after Hijack

CL 637939 changed ReverseProxy to report errors encountered when
copying data on an hijacked connection. This is generally not useful,
and when using the default error handler results in WriteHeader
being called on a hijacked connection.

While this is harmless with standard net/http ResponseWriter
implementations, it can confuse middleware layers.

Fixes #72954

Change-Id: I21f3d3d515e114dc5c298d7dbc3796c505d3c82f
Reviewed-on: https://go-review.googlesource.com/c/go/+/659255
Reviewed-by: Jonathan Amsterdam <jba@google.com>
Auto-Submit: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go