Skip to content
This repository was archived by the owner on Mar 10, 2020. It is now read-only.

Handle directories with odd names #456

Merged
merged 1 commit into from
Nov 28, 2016
Merged

Conversation

elsehow
Copy link
Contributor

@elsehow elsehow commented Nov 28, 2016

Previously, adding a directory with square brackets
resulted in a strange, silent error. This happened
because directory names were being passed to a file-
matching glob designed to recursively stream files from
the directory. When filenames contained meaningful glob
symbols (like [ or *), the glob matching would fail.

This commit resolves this problem by escaping glob
characters on filenames, before the filename is inserted
into the main glob in src/get-file-streams.js L48.
We add a dependency to glob-escape in the process,
and a new test in test/ipfs-api/util.spec.js.

Previously, adding a directory with square brackets
resulted in a strange, silent error [1]. This happened
because directory names were being passed to a file-
matching glob designed to recursively stream files from
the directory. When filenames contained meaningful glob
symbols (like [ or *), the glob matching would fail.

This commit resolves this problem by escaping glob
characters on filenames, before the filename is inserted
into the main glob in src/get-file-streams.js L48.
We add a dependency to glob-escape in the process,
and a new test in test/ipfs-api/util.spec.js.
@daviddias
Copy link
Contributor

awesome @elsehow! thank you for fixing this :)

@daviddias daviddias merged commit 5aed2f4 into ipfs-inactive:master Nov 28, 2016
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.

2 participants