Skip to content

Commit ed53ff1

Browse files
committed
fix: should set authorization header before setting request config
1 parent 1ea3048 commit ed53ff1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

pkg/squarego/rest/rest_client.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,13 +49,13 @@ func (c *clientImpl) Request(method, url string, rqBody []byte, rsBody any, opti
4949

5050
req.Header.Set("User-Agent", c.config.UserAgent)
5151

52-
cfg := DefaultRequestConfig(req)
53-
cfg.Apply(options)
54-
5552
if c.token != "" {
5653
req.Header.Set("Authorization", c.token)
5754
}
5855

56+
cfg := DefaultRequestConfig(req)
57+
cfg.Apply(options)
58+
5959
response, err := c.HTTPClient().Do(cfg.Request)
6060
if err != nil {
6161
return err

0 commit comments

Comments
 (0)