diff --git a/rpc/http/fasthttp/transport.go b/rpc/http/fasthttp/transport.go index acf5425..70d0fe2 100644 --- a/rpc/http/fasthttp/transport.go +++ b/rpc/http/fasthttp/transport.go @@ -96,7 +96,10 @@ func (trans *Transport) Transport(ctx context.Context, request []byte) (response if !trans.DisableHTTPHeader { clientContext.Items().Set("httpResponseHeaders", getResponseHeader(&resp.Header)) } - return resp.SwapBody(nil), nil + body := resp.Body() + bodycopy := make([]byte, len(body)) + copy(bodycopy, body) + return bodycopy, nil case fasthttp.StatusRequestEntityTooLarge: return nil, core.ErrRequestEntityTooLarge default: