Skip to content

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

@CodingKoopa

Description

@CodingKoopa

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] = "+"; // +

Metadata

Metadata

Assignees

Labels

bugUnexpected software behaviourwebdavIssue related to WebDAV support

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions