Socket
Socket
Sign inDemoInstall

@grpc/grpc-js

Package Overview
Dependencies
Maintainers
3
Versions
178
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@grpc/grpc-js - npm Package Compare versions

Comparing version 1.8.0 to 1.8.1

2

build/src/channel-options.d.ts

@@ -32,2 +32,3 @@ import { CompressionAlgorithms } from './compression-algorithms';

'grpc-node.max_session_memory'?: number;
'grpc.service_config_disable_resolution'?: number;
[key: string]: any;

@@ -63,3 +64,4 @@ }

'grpc-node.max_session_memory': boolean;
'grpc.service_config_disable_resolution': boolean;
};
export declare function channelOptionsEqual(options1: ChannelOptions, options2: ChannelOptions): boolean;

@@ -48,2 +48,3 @@ "use strict";

'grpc-node.max_session_memory': true,
'grpc.service_config_disable_resolution': true,
};

@@ -50,0 +51,0 @@ function channelOptionsEqual(options1, options2) {

@@ -72,2 +72,3 @@ "use strict";

this.isNextResolutionTimerRunning = false;
this.isServiceConfigEnabled = true;
trace('Resolver constructed for target ' + (0, uri_parser_1.uriToString)(target));

@@ -98,2 +99,5 @@ const hostPort = (0, uri_parser_1.splitHostPort)(target.path);

this.percentage = Math.random() * 100;
if (channelOptions['grpc.service_config_disable_resolution'] === 1) {
this.isServiceConfigEnabled = false;
}
this.defaultResolutionError = {

@@ -197,3 +201,3 @@ code: constants_1.Status.UNAVAILABLE,

* that result when it comes in */
if (this.pendingTxtPromise === null) {
if (this.isServiceConfigEnabled && this.pendingTxtPromise === null) {
/* We handle the TXT query promise differently than the others because

@@ -200,0 +204,0 @@ * the name resolution attempt as a whole is a success even if the TXT

@@ -140,2 +140,11 @@ "use strict";

this.trace('ended with status: code=' + statusObject.code + ' details="' + statusObject.details + '"');
this.bufferTracker.freeAll(this.callNumber);
for (let i = 0; i < this.writeBuffer.length; i++) {
if (this.writeBuffer[i].entryType === 'MESSAGE') {
this.writeBuffer[i] = {
entryType: 'FREED',
allocated: false
};
}
}
process.nextTick(() => {

@@ -142,0 +151,0 @@ var _a;

9

build/src/server-call.js

@@ -50,3 +50,3 @@ "use strict";

};
const defaultResponseHeaders = {
const defaultCompressionHeaders = {
// TODO(cjihrig): Remove these encoding headers from the default response

@@ -56,2 +56,4 @@ // once compression is integrated.

[GRPC_ENCODING_HEADER]: 'identity',
};
const defaultResponseHeaders = {
[http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK,

@@ -307,3 +309,3 @@ [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto',

// TODO(cjihrig): Include compression headers.
const headers = Object.assign(Object.assign({}, defaultResponseHeaders), custom);
const headers = Object.assign(Object.assign(Object.assign({}, defaultResponseHeaders), defaultCompressionHeaders), custom);
this.stream.respond(headers, defaultResponseOptions);

@@ -472,3 +474,4 @@ }

else {
const trailersToSend = Object.assign({ [GRPC_STATUS_HEADER]: statusObj.code, [GRPC_MESSAGE_HEADER]: encodeURI(statusObj.details) }, (_b = statusObj.metadata) === null || _b === void 0 ? void 0 : _b.toHttp2Headers());
// Trailers-only response
const trailersToSend = Object.assign(Object.assign({ [GRPC_STATUS_HEADER]: statusObj.code, [GRPC_MESSAGE_HEADER]: encodeURI(statusObj.details) }, defaultResponseHeaders), (_b = statusObj.metadata) === null || _b === void 0 ? void 0 : _b.toHttp2Headers());
this.stream.respond(trailersToSend, { endStream: true });

@@ -475,0 +478,0 @@ this.statusSent = true;

{
"name": "@grpc/grpc-js",
"version": "1.8.0",
"version": "1.8.1",
"description": "gRPC Library for Node - pure JS implementation",

@@ -5,0 +5,0 @@ "homepage": "https://grpc.io/",

@@ -65,2 +65,3 @@ # Pure JavaScript gRPC Client

- `grpc.retry_buffer_size`
- `grpc.service_config_disable_resolution`
- `grpc-node.max_session_memory`

@@ -67,0 +68,0 @@ - `channelOverride`

@@ -58,2 +58,3 @@ /*

'grpc-node.max_session_memory'?: number;
'grpc.service_config_disable_resolution'?: number;
// eslint-disable-next-line @typescript-eslint/no-explicit-any

@@ -91,2 +92,3 @@ [key: string]: any;

'grpc-node.max_session_memory': true,
'grpc.service_config_disable_resolution': true,
};

@@ -93,0 +95,0 @@

@@ -101,2 +101,3 @@ /*

private isNextResolutionTimerRunning = false;
private isServiceConfigEnabled = true;
constructor(

@@ -131,2 +132,6 @@ private target: GrpcUri,

if (channelOptions['grpc.service_config_disable_resolution'] === 1) {
this.isServiceConfigEnabled = false;
}
this.defaultResolutionError = {

@@ -260,3 +265,3 @@ code: Status.UNAVAILABLE,

* that result when it comes in */
if (this.pendingTxtPromise === null) {
if (this.isServiceConfigEnabled && this.pendingTxtPromise === null) {
/* We handle the TXT query promise differently than the others because

@@ -263,0 +268,0 @@ * the name resolution attempt as a whole is a success even if the TXT

@@ -205,2 +205,11 @@ /*

this.trace('ended with status: code=' + statusObject.code + ' details="' + statusObject.details + '"');
this.bufferTracker.freeAll(this.callNumber);
for (let i = 0; i < this.writeBuffer.length; i++) {
if (this.writeBuffer[i].entryType === 'MESSAGE') {
this.writeBuffer[i] = {
entryType: 'FREED',
allocated: false
};
}
}
process.nextTick(() => {

@@ -207,0 +216,0 @@ this.listener?.onReceiveStatus(statusObject);

@@ -66,3 +66,3 @@ /*

};
const defaultResponseHeaders = {
const defaultCompressionHeaders = {
// TODO(cjihrig): Remove these encoding headers from the default response

@@ -72,2 +72,4 @@ // once compression is integrated.

[GRPC_ENCODING_HEADER]: 'identity',
}
const defaultResponseHeaders = {
[http2.constants.HTTP2_HEADER_STATUS]: http2.constants.HTTP_STATUS_OK,

@@ -505,3 +507,3 @@ [http2.constants.HTTP2_HEADER_CONTENT_TYPE]: 'application/grpc+proto',

// TODO(cjihrig): Include compression headers.
const headers = { ...defaultResponseHeaders, ...custom };
const headers = { ...defaultResponseHeaders, ...defaultCompressionHeaders, ...custom };
this.stream.respond(headers, defaultResponseOptions);

@@ -731,5 +733,7 @@ }

} else {
// Trailers-only response
const trailersToSend = {
[GRPC_STATUS_HEADER]: statusObj.code,
[GRPC_MESSAGE_HEADER]: encodeURI(statusObj.details),
...defaultResponseHeaders,
...statusObj.metadata?.toHttp2Headers(),

@@ -736,0 +740,0 @@ };

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc