This repository has been archived by the owner on Mar 10, 2020. It is now read-only.
fix: config.set should reject buffer values #800
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
config.set
should be rejecting buffer values[0]. Currently it accepts them because a buffer returnstypeof
ofobject
, and is serialized into an object{type: 'buffer', data: [...]}
.This change brings the type checking of the
value
field inline with thejs-ipfs-repo
[1].More info: https://github.com/ipfs/interface-ipfs-core/issues/320
[0] https://github.com/ipfs/interface-ipfs-core/blob/ef910266b36c89fe21f9821f86bdb9955d60b468/js/src/config/set.js#L82-L87
[1] https://github.com/ipfs/js-ipfs-repo/blob/a7ea45bac6f1c264f86e79357f702314758a48f1/src/config.js#L65-L67