Skip to content

Commit 39c14df

Browse files
committed
fasthttp client: set HTTP method after copying the headers
As mentioned in #110, setting method before copying the headers results in default (GET) method being used.
1 parent 1c21a01 commit 39c14df

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clients.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ func (c *fasthttpClient) do() (
8181
// prepare the request
8282
req := fasthttp.AcquireRequest()
8383
resp := fasthttp.AcquireResponse()
84-
req.Header.SetMethod(c.method)
8584
if c.headers != nil {
8685
c.headers.CopyTo(&req.Header)
8786
}
87+
req.Header.SetMethod(c.method)
8888
req.SetURI(c.uri)
8989
req.UseHostHeader = true
9090
if c.body != nil {

0 commit comments

Comments
 (0)