feat: add verifier version to vsa

This commit is contained in:
mrjoelkamp
2024-10-16 12:01:31 -05:00
parent e39a4ea9f3
commit 84c0b116a7
6 changed files with 65 additions and 13 deletions

View File

@@ -19,10 +19,11 @@ func Set(ctx context.Context, userAgent string) context.Context {
// Get retrieves the HTTP user agent from the context.
func Get(ctx context.Context) string {
fetcher := version.NewGoVersionFetcher()
if ua, ok := ctx.Value(userAgentKey).(string); ok {
return ua
}
version, err := version.Get()
version, err := fetcher.Get()
if err != nil || version == nil {
return defaultUserAgent
}