[shared] allow setting a user agent for the rest client (#5037)

This commit is contained in:
Pascal Fischer
2026-01-06 10:52:36 +01:00
committed by GitHub
parent 7bb4fc3450
commit f022e34287
3 changed files with 62 additions and 0 deletions

View File

@@ -42,3 +42,10 @@ func WithAuthHeader(value string) option {
c.authHeader = value
}
}
// WithUserAgent sets a custom User-Agent header for HTTP requests
func WithUserAgent(userAgent string) option {
return func(c *Client) {
c.userAgent = userAgent
}
}