Skip to content

Commit

Permalink
Blank User-Agent header upon error
Browse files Browse the repository at this point in the history
Added return statement to send a blank User-Agent header on failure to open CHANGELOG.md
  • Loading branch information
rorywelch committed Jul 22, 2024
1 parent 2ade0fb commit 179a7f1
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions instana/restapi/rest-client.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,7 @@ func (client *restClientImpl) createRequest() *resty.Request {
file, err := os.Open(basepath + "/CHANGELOG.md")
if err != nil {
log.Println("Error: couldn't open file", basepath+"/CHANGELOG.md", err)
return client.restyClient.R().SetHeader("Accept", "application/json").SetHeader("Authorization", fmt.Sprintf("apiToken %s", client.apiToken)).SetHeader("user-agent", terraformProviderVersion)
}
defer file.Close()

Expand Down

0 comments on commit 179a7f1

Please sign in to comment.