From 978ece6fa03832b88089760ac2ca74f6c15784bd Mon Sep 17 00:00:00 2001 From: wjqserver <114663932+WJQSERVER@users.noreply.github.com> Date: Sun, 30 Mar 2025 17:25:36 +0800 Subject: [PATCH] remove reWriteEncodeHeader --- proxy/chunkreq.go | 2 -- proxy/reqheader.go | 3 ++- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/proxy/chunkreq.go b/proxy/chunkreq.go index b6edf2c..fdd54a5 100644 --- a/proxy/chunkreq.go +++ b/proxy/chunkreq.go @@ -24,7 +24,6 @@ func ChunkedProxyRequest(ctx context.Context, c *app.RequestContext, u string, c } setRequestHeaders(c, headReq) removeWSHeader(headReq) // 删除Conection Upgrade头, 避免与HTTP/2冲突(检查是否存在Upgrade头) - reWriteEncodeHeader(headReq) AuthPassThrough(c, cfg, headReq) headResp, err := client.Do(headReq) @@ -62,7 +61,6 @@ func ChunkedProxyRequest(ctx context.Context, c *app.RequestContext, u string, c } setRequestHeaders(c, req) removeWSHeader(req) // 删除Conection Upgrade头, 避免与HTTP/2冲突(检查是否存在Upgrade头) - reWriteEncodeHeader(req) AuthPassThrough(c, cfg, req) resp, err := client.Do(req) diff --git a/proxy/reqheader.go b/proxy/reqheader.go index 86e33d4..5e19109 100644 --- a/proxy/reqheader.go +++ b/proxy/reqheader.go @@ -2,7 +2,6 @@ package proxy import ( "net/http" - "strings" "github.com/cloudwego/hertz/pkg/app" ) @@ -19,6 +18,7 @@ func removeWSHeader(req *http.Request) { req.Header.Del("Connection") } +/* func reWriteEncodeHeader(req *http.Request) { if isGzipAccepted(req.Header) { @@ -46,3 +46,4 @@ func isGzipAccepted(header http.Header) bool { } return false } +*/