Skip to content

Commit

Permalink
rename to prepareProRequest
Browse files Browse the repository at this point in the history
  • Loading branch information
atavism committed Jun 24, 2024
1 parent 4e2b70d commit 34b73ed
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions internalsdk/pro/pro.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,13 +59,13 @@ func NewClient(baseURL string, opts *Opts) ProClient {
client := &proClient{
userConfig: opts.UserConfig,
}
client.webclient = webclient.NewRESTClient(defaultwebclient.SendToURL(httpClient, baseURL, client.setUserHeaders(), nil))
client.webclient = webclient.NewRESTClient(defaultwebclient.SendToURL(httpClient, baseURL, prepareProRequest(opts.UserConfig), nil))
return client
}

func (c *proClient) setUserHeaders() func(client *resty.Client, req *http.Request) error {
func prepareProRequest(userConfig func() common.UserConfig) func(client *resty.Client, req *http.Request) error {
return func(client *resty.Client, req *http.Request) error {
uc := c.userConfig()
uc := userConfig()
req.Header.Set("Referer", "http://localhost:37457/")
req.Header.Set("Access-Control-Allow-Headers", strings.Join([]string{
common.DeviceIdHeader,
Expand Down

0 comments on commit 34b73ed

Please sign in to comment.