]> Cypherpunks repositories - gostls13.git/commit
net/http/httputil: forward 1xx responses in ReverseProxy
authorKévin Dunglas <kevin@dunglas.fr>
Tue, 30 Aug 2022 10:18:50 +0000 (10:18 +0000)
committerGopher Robot <gobot@golang.org>
Wed, 14 Sep 2022 23:59:32 +0000 (23:59 +0000)
commit972870da11bb4ddd3df393473c494bd2b546cc56
tree3b6aa2cc2ca16b5e9f8e9dae2c2a45266d162432
parent4baa486983204fdff64f80809627f79a538d8d82
net/http/httputil: forward 1xx responses in ReverseProxy

Support for 1xx responses has recently been merged in
net/http (CL 269997).

As discussed in this CL
(https://go-review.googlesource.com/c/go/+/269997/comments/1ff70bef_c25a829a),
support for forwarding 1xx responses in ReverseProxy has been extracted
in this separate patch.

According to RFC 7231, "a proxy MUST forward 1xx responses unless the
proxy itself requested the generation of the 1xx response".
Consequently, all received 1xx responses are automatically forwarded as long as the
underlying transport supports ClientTrace.Got1xxResponse.

Fixes #26088
Fixes #51914

Change-Id: I3a35ea023b798bfe56b7fb8696d5a49695229cfd
GitHub-Last-Rev: dab8a461fb65b547306cae9b4c664e60020a8fa6
GitHub-Pull-Request: golang/go#53164
Reviewed-on: https://go-review.googlesource.com/c/go/+/409536
Reviewed-by: Damien Neil <dneil@google.com>
Auto-Submit: Dmitri Shuralyov <dmitshur@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Rhys Hiltner <rhys@justin.tv>
Run-TryBot: hopehook <hopehook@golangcn.org>
src/net/http/httputil/reverseproxy.go
src/net/http/httputil/reverseproxy_test.go