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 · 1 comment
Open

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

CodingKoopa opened this issue Dec 1, 2021 · 1 comment
Assignees
Labels
bug Unexpected software behaviour webdav Issue related to WebDAV support

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] = "+"; // +
@sergiohs84
Copy link
Contributor

Hi @CodingKoopa, and thanks for your detailed report, steps and even the workaround's proposal as an MR. It's very appreciated.

I've opened an internal ticket to look into the issue and to analyze if your PR is suitable for merging into develop. If so, we would honor your contribution by cherry-picking your commits into our private repository and you would eventually find them included in a future release. The reference ID is SDK-1803.

Thanks

@sergiohs84 sergiohs84 self-assigned this Dec 11, 2024
@sergiohs84 sergiohs84 added the bug Unexpected software behaviour label Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Unexpected software behaviour webdav Issue related to WebDAV support
Projects
None yet
Development

No branches or pull requests

2 participants