mirror of
https://github.com/woodchen-ink/proxy-go.git
synced 2025-07-18 00:21:56 +08:00
添加原始请求的查询参数到目标URL,以确保代理请求能够正确传递查询信息。
This commit is contained in:
parent
0335640df5
commit
d1db2835b4
@ -247,6 +247,11 @@ func (h *ProxyHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
|
||||
encodedPath := strings.Join(parts, "/")
|
||||
targetURL := targetBase + encodedPath
|
||||
|
||||
// 添加原始请求的查询参数
|
||||
if r.URL.RawQuery != "" {
|
||||
targetURL = targetURL + "?" + r.URL.RawQuery
|
||||
}
|
||||
|
||||
// 解析目标 URL 以获取 host
|
||||
parsedURL, err := url.Parse(targetURL)
|
||||
if err != nil {
|
||||
|
Loading…
x
Reference in New Issue
Block a user