remove reWriteEncodeHeader

This commit is contained in:
wjqserver 2025-03-30 17:25:36 +08:00
parent 1adc3a3192
commit 978ece6fa0
2 changed files with 2 additions and 3 deletions

View file

@ -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)

View file

@ -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
}
*/