From b4367cd3aba812fb26dbce83aa914c3fda79d6f0 Mon Sep 17 00:00:00 2001 From: cjihrig Date: Thu, 27 Sep 2018 20:12:43 -0400 Subject: [PATCH] grpc-js-core: update compression flag byte offset The compression flag is written to the first byte, but read from the second byte. Update the read offset to match. --- packages/grpc-js-core/src/compression-filter.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/grpc-js-core/src/compression-filter.ts b/packages/grpc-js-core/src/compression-filter.ts index 6c874619..24d513dc 100644 --- a/packages/grpc-js-core/src/compression-filter.ts +++ b/packages/grpc-js-core/src/compression-filter.ts @@ -29,7 +29,7 @@ abstract class CompressionHandler { * @return Uncompressed message */ async readMessage(data: Buffer): Promise { - const compressed = data.readUInt8(1) === 1; + const compressed = data.readUInt8(0) === 1; let messageBuffer = data.slice(5); if (compressed) { messageBuffer = await this.decompressMessage(messageBuffer);