docs: explain reverse proxy query normalization
Some checks failed
Go Test / test (push) Has been cancelled

Clarify that outgoing proxy queries are normalized before forwarding, which may re-encode or drop non-standard fragments to keep parsing behavior consistent across proxy chains.
This commit is contained in:
wjqserver 2026-03-29 01:48:50 +08:00
parent 6d89b8674f
commit 8031e799d9
2 changed files with 7 additions and 0 deletions

View file

@ -910,6 +910,11 @@ func cleanReverseProxyQueryParams(rawQuery string) string {
if rawQuery == "" {
return ""
}
// Normalize the outgoing query string so the proxy and upstream do not see
// different semantics for non-standard separators or malformed pairs.
// This can change the exact textual form of the original query and may drop
// parts that net/url rejects, but it keeps proxy-chain parsing behavior more
// consistent and reduces parameter-smuggling ambiguity.
values, _ := url.ParseQuery(rawQuery)
return values.Encode()
}