Skip to content

v4: Should send bytes instead of UTF-16 length #1628

@MCPE-PC

Description

@MCPE-PC

Issue

Describe your issue here

For Node Redis v4, the code seems to be using String.prototype.length to calculate the byte length of an argument to load on the payload
https://github.com/NodeRedis/node-redis/blob/c72aab2fc29a9cc994f6b810aeb10a4fe1863f29/lib/commands-queue.ts#L52-L53
It should load the byte length instead. Buffer.byteLength(String.prototype) is one of its ways.


Environment

  • Node.js Version: 16.0.0
  • Redis Version: 6.2.4
  • Platform: Linux MCPEPC-DESKTOP 5.8.0-59-generic #66~20.04.1-Ubuntu SMP Thu Jun 17 11:14:10 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions