Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Response of INFO command is incorrectly parsed in _readyCheck #1126

Closed
Rua-Yuki opened this issue May 8, 2020 · 1 comment · Fixed by #1127
Closed

Response of INFO command is incorrectly parsed in _readyCheck #1126

Rua-Yuki opened this issue May 8, 2020 · 1 comment · Fixed by #1127
Labels

Comments

@Rua-Yuki
Copy link
Contributor

Rua-Yuki commented May 8, 2020

Node version: 10.19.0
ioredis version: 4.16.3


The logic within _readyCheck which parses the response of an INFO query is not fully conformant with this command's response format, and may produce incorrect data in some cases.

For instance, given an INFO response with:

# Server
config_file:Y:\redis\redis.conf

The object generated from parsing this data would contain the following incorrect data:

{
  config_file: 'Y'
}

This issue will occur with any info field containing a colon in the value string, as a result of the key-value parsing logic assuming only two colon-delimited components (key and value) may exist:

https://github.com/luin/ioredis/blob/16a06102fa4fa537be926b7e68601c777f0c64b5/lib/redis/index.ts#L508

I understand that this value is mainly parsed for the intention of checking Redis' loading state, and so complete conformance isn't likely to be an issue here.

However, because this info is eventually exposed under the client's serverInfo field, which some libraries have made use of, there would be some benefit at least in correcting this INFO parser.

@ioredis-robot
Copy link
Collaborator

🎉 This issue has been resolved in version 4.17.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants