mnutt / davros

Personal file storage server
Apache License 2.0
297 stars 35 forks source link

When dropping files into a directory with spaces into its name, A duplicate directory with %20s is created #144

Open zenhack opened 2 years ago

zenhack commented 2 years ago

Steps to reproduce:

  1. Create a new davros grain
  2. Create a directory with a space in its name, e.g. A Directory.
  3. Enter that directory.
  4. Drop some files into the directory.
  5. Go back up

There will then be two directories:

The files will be in the former; the latter will be empty.

spollard commented 2 years ago

I reproduced this bug and figured out a fix for it. Github is bothering me about 2 factor authentication and auth tokens yet again, so I just pushed my commit up to my sandstorm instead.

https://sandstorm.stephentpollard.com/shared/odh0IskHfMcEpYWRCG6mVOjGrWQ7i-fZGbUgvXDupxb

The fix, which is to decode the URI, could happen in app/components/davros-uploader.js (like I did), or app/models/files.js:ensureCollectionExists(), or even app/lib/ensure-collection-exists.js. I'm not sure where the best place is.

Perhaps I'll make a proper pull request if I can get github to let me push to my fork...