mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-11 03:06:51 +02:00
tweak: consolidate bytes pool management and enhance CopyClose functionality for improved performance
This commit is contained in:
@@ -411,7 +411,7 @@ func (p *ReverseProxy) handler(rw http.ResponseWriter, req *http.Request) {
|
||||
|
||||
rw.WriteHeader(res.StatusCode)
|
||||
|
||||
err = U.CopyCloseWithContext(ctx, rw, res.Body) // close now, instead of defer, to populate res.Trailer
|
||||
err = U.CopyCloseWithContext(ctx, rw, res.Body, int(res.ContentLength)) // close now, instead of defer, to populate res.Trailer
|
||||
if err != nil {
|
||||
if !errors.Is(err, context.Canceled) {
|
||||
p.errorHandler(rw, req, err, false)
|
||||
|
||||
Reference in New Issue
Block a user