Skip to content

Commit

Permalink
fix: 修复 HttpHook AfterRequest 执行错误 (#387)
Browse files Browse the repository at this point in the history
  • Loading branch information
eatmoreapple authored Jul 29, 2023
1 parent 78dafb4 commit c0dae3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion client.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ func (c *Client) do(req *http.Request) (*http.Response, error) {
)

c.HttpHooks.BeforeRequest(req)
defer c.HttpHooks.AfterRequest(resp, err)
defer func() { c.HttpHooks.AfterRequest(resp, err) }()

for i := 0; i < c.MaxRetryTimes; i++ {
resp, err = c.client.Do(req)
Expand Down

0 comments on commit c0dae3d

Please sign in to comment.