Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

fix: strip control characters from user output #3420

Merged
merged 3 commits into from
Nov 25, 2020

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Nov 24, 2020

Removes control characters (e.g. char code < 32 or 127 (DEL)) from any fields printed by the CLI that could have once have been user input.

For jsipfs dag get it attempts to strip control characters from dag-pb and dag-cbor nodes and escapes them from everything else.

raw nodes get blurted into the terminal the same as if you'd done jsipfs cat ...

Also brings the output of jsipfs dag get more into line with go-ipfs and allows specifying which encoding to display data fields in.

Removes control characters (e.g. char code < 32) from any fields
printed by the CLI that could have once have been user input.

For `jsipfs dag get` it attempts to strip control characters from
dag-pb and dag-cbor nodes and escapes them from everything else.

raw nodes get blurted into the terminal the same as if you'd done
`jsipfs cat ...`
Copy link
Contributor

@jacobheun jacobheun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

minor jsdoc comment issues otherwise this looks good

packages/ipfs-cli/src/utils.js Outdated Show resolved Hide resolved
@achingbrain achingbrain merged commit d13b064 into master Nov 25, 2020
@achingbrain achingbrain deleted the fix/strip-control-characters-from-cli-output branch November 25, 2020 07:17
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants