From bd8412f15767cdd02a2ff22ebf983187a578c102 Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Sat, 14 Jun 2025 06:51:41 +0800 Subject: [PATCH] 25w46b --- DEV-VERSION | 2 +- proxy/chunkreq.go | 19 ++++++++++--------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/DEV-VERSION b/DEV-VERSION index 09188a8..99cdc41 100644 --- a/DEV-VERSION +++ b/DEV-VERSION @@ -1 +1 @@ -25w46a \ No newline at end of file +25w46b \ No newline at end of file diff --git a/proxy/chunkreq.go b/proxy/chunkreq.go index 9ec1cc2..5fa4728 100644 --- a/proxy/chunkreq.go +++ b/proxy/chunkreq.go @@ -1,7 +1,6 @@ package proxy import ( - "bytes" "context" "fmt" "ghproxy/config" @@ -33,8 +32,8 @@ func ChunkedProxyRequest(ctx context.Context, c *app.RequestContext, u string, c rb := client.NewRequestBuilder(string(c.Request.Method()), u) rb.NoDefaultHeaders() - rb.SetBody(bytes.NewBuffer(c.Request.Body())) - //rb.SetBody(c.RequestBodyStream()) + //rb.SetBody(bytes.NewBuffer(c.Request.Body())) + rb.SetBody(c.RequestBodyStream()) rb.WithContext(ctx) req, err = rb.Build() @@ -112,12 +111,14 @@ func ChunkedProxyRequest(ctx context.Context, c *app.RequestContext, u string, c bodyReader = limitreader.NewRateLimitedReader(bodyReader, bandwidthLimit, int(bandwidthBurst), ctx) } - defer func() { - err := bodyReader.Close() - if err != nil { - logError("Failed to close response body: %v", err) - } - }() + /* + defer func() { + err := bodyReader.Close() + if err != nil { + logError("Failed to close response body: %v", err) + } + }() + */ if MatcherShell(u) && matchString(matcher) && cfg.Shell.Editor { // 判断body是不是gzip