Commit cc4f945d authored by leitao.zhang's avatar leitao.zhang

优化参数拼接

parent 9b883b5b
......@@ -165,7 +165,22 @@ func Proxy(c *gin.Context) {
reqURL.RawQuery = c.Request.URL.RawQuery
} else {
if c.Request.URL.RawQuery != "" {
reqURL.RawQuery += "&" + c.Request.URL.RawQuery
oldQ := c.Request.URL.Query()
newQ := c.Request.URL.Query()
for k, v := range newQ {
if len(v) > 1 {
for kk, vv := range v {
if kk == 0 {
oldQ.Set(k, vv)
} else {
oldQ.Add(k, vv)
}
}
} else {
oldQ.Set(k, v[0])
}
}
reqURL.RawQuery = oldQ.Encode()
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment