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.
This commit is contained in:
cjihrig 2018-09-27 20:12:43 -04:00
parent 8664fd90b0
commit b4367cd3ab
No known key found for this signature in database
GPG Key ID: 7434390BDBE9B9C5
1 changed files with 1 additions and 1 deletions

View File

@ -29,7 +29,7 @@ abstract class CompressionHandler {
* @return Uncompressed message
*/
async readMessage(data: Buffer): Promise<Buffer> {
const compressed = data.readUInt8(1) === 1;
const compressed = data.readUInt8(0) === 1;
let messageBuffer = data.slice(5);
if (compressed) {
messageBuffer = await this.decompressMessage(messageBuffer);