We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f47399b commit b78fdb5Copy full SHA for b78fdb5
commands/instances.go
@@ -67,6 +67,24 @@ func (s *arduinoCoreServerImpl) Create(ctx context.Context, req *rpc.CreateReque
67
var userAgent string
68
if md, ok := metadata.FromIncomingContext(ctx); ok {
69
userAgent = strings.Join(md.Get("user-agent"), " ")
70
+ if userAgent != "" {
71
+ // s.SettingsGetValue() returns an error if the key does not exist and for this reason we are accessing
72
+ // network.user_agent_ext directly from s.settings.ExtraUserAgent() to set it
73
+ if s.settings.ExtraUserAgent() == "" {
74
+ if strings.Contains(userAgent, "arduino-ide/2") {
75
+ // needed for analytics purposes
76
+ userAgent = userAgent + " daemon"
77
+ }
78
+ _, err := s.SettingsSetValue(ctx, &rpc.SettingsSetValueRequest{
79
+ Key: "network.user_agent_ext",
80
+ ValueFormat: "cli",
81
+ EncodedValue: userAgent,
82
+ })
83
+ if err != nil {
84
+ return nil, err
85
86
87
88
}
89
90
// Setup downloads directory
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments