Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function GrpcService(config, options) {
if (global.GCLOUD_SANDBOX_ENV) {
// gRPC has a tendency to cause our doc unit tests to fail, so we prevent
// any calls to that library from going through.
// Reference: https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1137#issuecomment-193315047
return global.GCLOUD_SANDBOX_ENV;
}
Service.call(this, config, options);
if (config.customEndpoint) {
this.grpcCredentials = grpc.credentials.createInsecure();
}
this.grpcMetadata = new grpc.Metadata();
this.grpcMetadata.add('x-goog-api-client', [
'gl-node/' + process.versions.node,
'gccl/' + config.packageJson.version,
'grpc/' + require('grpc/package.json').version
].join(' '));
if (config.grpcMetadata) {
for (var prop in config.grpcMetadata) {
if (config.grpcMetadata.hasOwnProperty(prop)) {
function GrpcService(config, options) {
if (global.GCLOUD_SANDBOX_ENV) {
// gRPC has a tendency to cause our doc unit tests to fail, so we prevent
// any calls to that library from going through.
// Reference: https://github.com/GoogleCloudPlatform/google-cloud-node/pull/1137#issuecomment-193315047
return global.GCLOUD_SANDBOX_ENV;
}
Service.call(this, config, options);
if (config.customEndpoint) {
this.grpcCredentials = grpc.credentials.createInsecure();
}
this.grpcMetadata = new grpc.Metadata();
this.grpcMetadata.add('x-goog-api-client', [
'gl-node/' + process.versions.node,
'gccl/' + config.packageJson.version,
'grpc/' + require('grpc/package.json').version
].join(' '));
if (config.grpcMetadata) {
for (var prop in config.grpcMetadata) {
if (config.grpcMetadata.hasOwnProperty(prop)) {