From 3b7564aca0b69384cf71eb6b42581c522eaa4ade Mon Sep 17 00:00:00 2001 From: samwaf Date: Tue, 21 Oct 2025 17:20:38 +0800 Subject: [PATCH] fix: request content_length #486 --- wafenginecore/content_encoding.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/wafenginecore/content_encoding.go b/wafenginecore/content_encoding.go index 489eb59..756e027 100644 --- a/wafenginecore/content_encoding.go +++ b/wafenginecore/content_encoding.go @@ -283,12 +283,5 @@ func (waf *WafEngine) decompressRequestContent(req *http.Request) ([]byte, error return bodyBytes, fmt.Errorf("读取解压后的请求体失败: %v", readErr) } - // 更新请求体为解压后的内容 - req.Body = io.NopCloser(bytes.NewBuffer(decompressedBytes)) - // 移除Content-Encoding头,因为内容已经解压 - req.Header.Del("Content-Encoding") - // 更新Content-Length - req.Header.Set("Content-Length", fmt.Sprintf("%d", len(decompressedBytes))) - return decompressedBytes, nil }