This commit is contained in:
gospider
2025-02-14 13:44:48 +08:00
parent f57ab9b73c
commit 7ed054a51d
3 changed files with 21 additions and 21 deletions

View File

@@ -327,9 +327,9 @@ func (obj *Client) request(ctx *Response) (err error) {
ctx.webSocket = websocket.NewClientConn(ctx.rawConn.Conn(), websocket.GetResponseHeaderOption(ctx.response.Header))
} else if strings.Contains(ctx.response.Header.Get("Content-Type"), "text/event-stream") {
ctx.sse = newSSE(ctx)
} else if !ctx.response.Uncompressed {
} else if encoding := ctx.ContentEncoding(); encoding != "" {
var unCompressionBody io.ReadCloser
unCompressionBody, err = tools.CompressionDecode(ctx.Context(), ctx.Body(), ctx.ContentEncoding())
unCompressionBody, err = tools.CompressionHeadersDecode(ctx.Context(), ctx.Body(), encoding)
if err != nil {
if err != io.ErrUnexpectedEOF && err != io.EOF {
return