Skip to content

Commit 3dbd123

Browse files
committed
Fixed compress
1 parent 10024ac commit 3dbd123

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

rpc/fasthttp/fasthttp_client.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ func (client *FastHTTPClient) sendAndReceive(
188188
req.Header.Set("Connection", "close")
189189
}
190190
if client.compression {
191-
req.Header.Set("Content-Encoding", "gzip")
191+
req.Header.Set("Accept-Encoding", "gzip")
192192
}
193193
resp := fasthttp.AcquireResponse()
194194
err := client.Client.DoTimeout(req, resp, context.Timeout)
@@ -200,9 +200,7 @@ func (client *FastHTTPClient) sendAndReceive(
200200
}
201201
header = make(http.Header)
202202
resp.Header.VisitAll(func(key, value []byte) {
203-
k := util.ByteString(key)
204-
v := util.ByteString(value)
205-
header.Add(k, v)
203+
header.Add(util.ByteString(key), util.ByteString(value))
206204
})
207205
context.Set("httpHeader", header)
208206
fasthttp.ReleaseRequest(req)

0 commit comments

Comments
 (0)