Skip to content

Commit

Permalink
Use a default user agent
Browse files Browse the repository at this point in the history
  • Loading branch information
koplas committed Jul 25, 2024
1 parent 257c316 commit 056c939
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions util/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,11 @@ func (hc *HeaderClient) Do(req *http.Request) (*http.Response, error) {
req.Header.Add(key, v)
}
}

// Use default user agent if none is set
if userAgent := hc.Header.Get("user-agent"); userAgent == "" {
req.Header.Add("user-agent", "csaf-distribution "+SemVersion)
}
return hc.Client.Do(req)
}

Expand Down

0 comments on commit 056c939

Please sign in to comment.