Skip to content

Commit

Permalink
feat: Add capability id header for all NerdGraph requests (#1049)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbazhlekova authored Aug 24, 2023
1 parent bc87cb6 commit 5f82f63
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions internal/http/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -535,5 +535,11 @@ func (c *Client) NewNerdGraphRequest(query string, vars map[string]interface{},
req.SetAuthStrategy(&NerdGraphAuthorizer{})
req.SetErrorValue(&GraphQLErrorResponse{})

if strings.Contains(c.config.ServiceName, "terraform-provider-newrelic") {
req.SetHeader("X-Query-Source-Capability-Id", "TERRAFORM")
} else {
req.SetHeader("X-Query-Source-Component-Id", c.config.ServiceName)
}

return req, nil
}

0 comments on commit 5f82f63

Please sign in to comment.