Skip to content

Commit

Permalink
Add user agent to api cmd requests
Browse files Browse the repository at this point in the history
  • Loading branch information
sergiught committed Nov 28, 2022
1 parent 26eec53 commit 96dd7b2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions internal/cli/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/spf13/cobra"

"github.com/auth0/auth0-cli/internal/ansi"
"github.com/auth0/auth0-cli/internal/buildinfo"
)

const apiDocsURL = "https://auth0.com/docs/api/management/v2"
Expand Down Expand Up @@ -101,6 +102,7 @@ func apiCmdRun(cli *cli, inputs *apiCmdInputs) func(cmd *cobra.Command, args []s
bearerToken := cli.config.Tenants[cli.tenant].AccessToken
request.Header.Set("Authorization", fmt.Sprintf("Bearer %s", bearerToken))
request.Header.Set("Content-Type", "application/json")
request.Header.Set("User-Agent", fmt.Sprintf("%s/%s", userAgent, strings.TrimPrefix(buildinfo.Version, "v")))

response, err = http.DefaultClient.Do(request)
return err
Expand Down

0 comments on commit 96dd7b2

Please sign in to comment.