cmd/uplink: use configured user agent
This change fixes an issue where the configured user agent wasn't used by Uplink commands. Resolves storj/customer-issues#999 Change-Id: I2d9f38308eddad7c471a100c968082783c05a3b3
This commit is contained in:
parent
f42548ac1c
commit
012e1fbc06
@ -43,6 +43,16 @@ func (ex *external) OpenProject(ctx context.Context, accessName string, options
|
||||
UserAgent: uplinkCLIUserAgent,
|
||||
}
|
||||
|
||||
userAgents, err := ex.Dynamic("client.user-agent")
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if len(userAgents) > 0 {
|
||||
if ua := userAgents[len(userAgents)-1]; ua != "" {
|
||||
config.UserAgent = ua
|
||||
}
|
||||
}
|
||||
|
||||
if opts.ConnectionPoolOptions != (rpcpool.Options{}) {
|
||||
if err := transport.SetConnectionPool(ctx, &config, rpcpool.New(opts.ConnectionPoolOptions)); err != nil {
|
||||
return nil, err
|
||||
|
Loading…
Reference in New Issue
Block a user