Skip to content

Commit

Permalink
fix: use the correct base User-Agent for metal-go requests (#437)
Browse files Browse the repository at this point in the history
The code that injects terraform module information into the User-Agent
string for the metal-go client was mis-wired; it was using the packngo
User-Agent as a base instead of the metal-go User-Agent. This change
will correct the User-Agent so that requests made with metal-go will not
appear to come from packngo.
  • Loading branch information
displague authored Nov 2, 2023
2 parents 5d6958a + dcfc5f4 commit 39c721c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion equinix/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@ func (c *Config) addModuleToMetalUserAgent(d *schema.ResourceData) {
}

func (c *Config) addModuleToMetalGoUserAgent(d *schema.ResourceData) {
c.metalgo.GetConfig().UserAgent = generateModuleUserAgentString(d, c.metalUserAgent)
c.metalgo.GetConfig().UserAgent = generateModuleUserAgentString(d, c.metalGoUserAgent)
}

func generateModuleUserAgentString(d *schema.ResourceData, baseUserAgent string) string {
Expand Down

0 comments on commit 39c721c

Please sign in to comment.