spanner: remove user agent
The version strings are already reported in x-goog-api-client.
Nothing looks for this content in user-agent header,
so we're just sending waste characters.
@@ -38,9 +38,9 @@ const (
// resourcePrefixHeader is the name of the metadata header used to indicate
// the resource being operated on.
resourcePrefixHeader = "google-cloud-resource-prefix"
- // apiClientHeader is the name of the metadata header used to indicate client
+ // xGoogHeaderKey is the name of the metadata header used to indicate client
// information.
- apiClientHeader = "x-goog-api-client"
+ xGoogHeaderKey = "x-goog-api-client"
// numChannels is the default value for NumChannels of client
numChannels = 4
@@ -56,7 +56,7 @@ const (
var (
validDBPattern = regexp.MustCompile("^projects/[^/]+/instances/[^/]+/databases/[^/]+$")
- clientUserAgent = fmt.Sprintf("gl-go/%s gccl/%s grpc/%s", version.Go(), version.Repo, grpc.Version)
+ xGoogHeaderVal = fmt.Sprintf("gl-go/%s gccl/%s grpc/%s", version.Go(), version.Repo, grpc.Version)
)
func validDatabaseName(db string) error {
@@ -123,9 +123,9 @@ func NewClientWithConfig(ctx context.Context, database string, config ClientConf
database: database,
md: metadata.Pairs(
resourcePrefixHeader, database,
- apiClientHeader, clientUserAgent),
+ xGoogHeaderKey, xGoogHeaderVal),
}
- allOpts := []option.ClientOption{option.WithEndpoint(prodAddr), option.WithScopes(Scope), option.WithUserAgent(clientUserAgent), option.WithGRPCDialOption(grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(100<<20), grpc.MaxCallRecvMsgSize(100<<20)))}
+ allOpts := []option.ClientOption{option.WithEndpoint(prodAddr), option.WithScopes(Scope), option.WithGRPCDialOption(grpc.WithDefaultCallOptions(grpc.MaxCallSendMsgSize(100<<20), grpc.MaxCallRecvMsgSize(100<<20)))}
allOpts = append(allOpts, opts...)
// Prepare gRPC channels.
if config.NumChannels == 0 {
