havardgulldahl / jottalib

A library to access files stored at jottacloud.com.
GNU General Public License v3.0
83 stars 19 forks source link

Preserve and sanitize file paths that contain urlencoding #25

Closed havardgulldahl closed 8 years ago

havardgulldahl commented 9 years ago

In jottacloudclient, when syncing file trees, a local path such as this:

/Movies/iMovie Projects.localized/Mitt første prosjekt.rcproject/Proxies/%2FVolumes%2FMedia%2FiMovie%20Events%2Elocalized%2Farbeidsbenk%2FIMG_4416%2EMOV

(%2F being urlencoding for /, some iMovie dev has been really clever here)

Will end up in this confused request:

DEBUG:root:getting url: .../jcctest/Movies/iMovie Projects.localized/Mitt første prosjekt.rcproject/Proxies/%2FVolumes%2FMedia%2FiMovie%20Events%2Elocalized%2Farbeidsbenk%2FIMG_4416%2EMOV, usecache=True, extra_headers=None
DEBUG:requests.packages.urllib3.connectionpool:"GET .../jcctest/Movies/iMovie%20Projects.localized/Mitt%20f%C3%B8rste%20prosjekt.rcproject/Proxies/%2FVolumes%2FMedia%2FiMovie%20Events.localized%2Farbeidsbenk%2FIMG_4416.MOV HTTP/1.1" 200 None
INFO:root:syncing .../jcctest/Movies/iMovie Projects.localized/Mitt første prosjekt.rcproject/Proxies/IMG_4416.MOV

Somewhere, jottalib erroneously decodes the encoded path and then strips away everything but the file name.