studio-b12 / gowebdav

A golang WebDAV client library and command line tool.
BSD 3-Clause "New" or "Revised" License
309 stars 89 forks source link

Error on Folders with '+' #40

Closed needsaholiday closed 3 years ago

needsaholiday commented 3 years ago

Hello Collaborators,

Describe the bug

When we want to Propfind a folder which contains folders with "+", the call fails. Due to the QueryUnescape at https://github.com/studio-b12/gowebdav/blob/master/client.go#L141 the "+" results in a wrong foldername. in this case "lost+found" becomes "lost found".

Not sure what the purpose of QueryUnescape is, but once we remove it, it works just fine.

Software

To Reproduce

  1. Create a folder 'lost+found' in a folder 'a'
  2. Propfind folder 'a'
  3. Propfind returns 'lost found' as the folder name

Expected Expected the folder name "lost+found" to stay that way

chuckwagoncomputing commented 3 years ago

I think the real fix here is to use PathUnescape instead of QueryUnescape. It treats '+' properly.

chripo commented 3 years ago

+1 thank you.

needsaholiday commented 3 years ago

@chuckwagoncomputing true story. Thank you. Applied it to the pull request #41