fix issue in http proxy when repeatable reading request body content (#2666)

This commit is contained in:
John Guo
2023-05-25 11:56:12 +08:00
committed by GitHub
parent 2329622564
commit a4762d0e02
2 changed files with 5 additions and 4 deletions

View File

@ -44,6 +44,7 @@ func StartServer2() {
)
r.Request.URL.Path = proxyToPath
g.Log().Infof(r.Context(), `server2:"%s" -> server1:"%s"`, originalPath, proxyToPath)
r.MakeBodyRepeatableRead(false)
proxy.ServeHTTP(r.Response.Writer.RawWriter(), r.Request)
})
s.SetPort(PortOfServer2)