Skip to content

Commit

Permalink
cleanup useragent setting
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Blaschke <[email protected]>
  • Loading branch information
mblaschke committed Sep 6, 2023
1 parent 5332f5e commit 6cc0a39
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 14 deletions.
8 changes: 1 addition & 7 deletions azuresdk/armclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -230,14 +230,8 @@ func (azureClient *ArmClient) perRetryPolicies() (policies []policy.Policy) {

// telemetryOptions generates telemetry options
func (azureClient *ArmClient) telemetryOptions() policy.TelemetryOptions {
// add userAgent (max 24 chars)
userAgent := strings.TrimSpace(azureClient.userAgent)
if len(userAgent) > 24 {
userAgent = userAgent[:24]
}

return policy.TelemetryOptions{
ApplicationID: userAgent,
ApplicationID: strings.TrimSpace(azureClient.userAgent),
Disabled: false,
}
}
Expand Down
8 changes: 1 addition & 7 deletions msgraphsdk/msgraphclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,8 @@ func (c *MsGraphClient) perRetryPolicies() (policies []policy.Policy) {

// telemetryOptions generates telemetry options
func (c *MsGraphClient) telemetryOptions() policy.TelemetryOptions {
// add userAgent (max 24 chars)
userAgent := strings.TrimSpace(c.userAgent)
if len(userAgent) > 24 {
userAgent = userAgent[:24]
}

return policy.TelemetryOptions{
ApplicationID: userAgent,
ApplicationID: strings.TrimSpace(c.userAgent),
Disabled: false,
}
}
Expand Down

0 comments on commit 6cc0a39

Please sign in to comment.