Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML4 entities don't work with all WebDAV clients #2599

Open
CodingKoopa opened this issue Dec 1, 2021 · 0 comments
Open

HTML4 entities don't work with all WebDAV clients #2599

CodingKoopa opened this issue Dec 1, 2021 · 0 comments

Comments

@CodingKoopa
Copy link

CodingKoopa commented Dec 1, 2021

Pull request #1250 changed the WebDAV server to have it escape all HTML4 entities, but some of them seem to cause issues for certain WebDAV clients.

Reproduction

  • Create a file containing the character +.
  • Start the WebDAV server, e.g. ./mega-exec webdav /
  • Attempt to list the directory using an affected tool. I tested cadaver and rclone, which did have the issue. Firefox accessing the folder did not exhibit the issue.

When listing the directory with cadaver, the following error occurs:

XML parse error at line 56: undefined entity

When listing the directory with rclone, with the command rclone lsi mega-webdav: (where mega-webdav is the name I gave to the remote), the following error occurs:

error listing: couldn't list files: XML syntax error on line 56: invalid character entity &add;

Solution

Indeed, if we look at the source code for cadaver, we see that it uses the Expat XML parser, which does not appear to implement the HTML4 entities. It does, however, support specifying characters by number. Thus, I was able to make it work with cadaver and rclone like so:

src/utils.cpp

-        escapesec[43] = "&add;"; // +
+        escapesec[43] = "+"; // +
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant