]> Cypherpunks repositories - gostls13.git/commitdiff
net/http/httputil: document ProxyRequest.SetURL limitations
authorSean Liao <sean@liao.dev>
Mon, 17 Mar 2025 19:20:32 +0000 (19:20 +0000)
committerSean Liao <sean@liao.dev>
Tue, 18 Mar 2025 19:57:12 +0000 (12:57 -0700)
Fixes #50337

Change-Id: I898ff6352f46f0f9b540b053049c5116e2165827
Reviewed-on: https://go-review.googlesource.com/c/go/+/658536
Reviewed-by: Damien Neil <dneil@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cherry Mui <cherryyz@google.com>
src/net/http/httputil/reverseproxy.go

index 079d5c86f782208a226e9e6b3a99a2c9986ebfb7..5d2788073596f0fa0a9bb5493b023668e960600e 100644 (file)
@@ -42,6 +42,8 @@ type ProxyRequest struct {
 // SetURL routes the outbound request to the scheme, host, and base path
 // provided in target. If the target's path is "/base" and the incoming
 // request was for "/dir", the target request will be for "/base/dir".
+// To route requests without joining the incoming path,
+// set r.Out.URL directly.
 //
 // SetURL rewrites the outbound Host header to match the target's host.
 // To preserve the inbound request's Host header (the default behavior