mirror of
https://github.com/yusing/godoxy.git
synced 2026-03-19 07:54:48 +01:00
tweak: consolidate bytes pool management and enhance CopyClose functionality for improved performance
This commit is contained in:
@@ -218,7 +218,7 @@ func (p *ReverseProxy) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
|
||||
|
||||
rw.WriteHeader(res.StatusCode)
|
||||
|
||||
err = utils.CopyCloseWithContext(ctx, rw, res.Body)
|
||||
err = utils.CopyCloseWithContext(ctx, rw, res.Body, int(res.ContentLength))
|
||||
if err != nil {
|
||||
if !errors.Is(err, context.Canceled) {
|
||||
p.getErrorHandler()(rw, req, err)
|
||||
|
||||
Reference in New Issue
Block a user