Skip to content

Commit c8eced8

Browse files
committed
net/http/httputil: document ProxyRequest.SetURL limitations
Fixes #50337 Change-Id: I898ff6352f46f0f9b540b053049c5116e2165827 Reviewed-on: https://go-review.googlesource.com/c/go/+/658536 Reviewed-by: Damien Neil <[email protected]> LUCI-TryBot-Result: Go LUCI <[email protected]> Reviewed-by: Cherry Mui <[email protected]>
1 parent 6b18311 commit c8eced8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/net/http/httputil/reverseproxy.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@ type ProxyRequest struct {
4242
// SetURL routes the outbound request to the scheme, host, and base path
4343
// provided in target. If the target's path is "/base" and the incoming
4444
// request was for "/dir", the target request will be for "/base/dir".
45+
// To route requests without joining the incoming path,
46+
// set r.Out.URL directly.
4547
//
4648
// SetURL rewrites the outbound Host header to match the target's host.
4749
// To preserve the inbound request's Host header (the default behavior

0 commit comments

Comments
 (0)