meganz / sdk

MEGA C++ SDK
BSD 2-Clause "Simplified" License
1.33k stars 504 forks source link

[webdav] Reduce list of escaped entities to be more compliant #2596

Open thebrave opened 2 years ago

thebrave commented 2 years ago

Hi, I'm having an issue with MEGAcmd as the webdav server and rclone as the client.

2021/11/24 09:22:55 ERROR : : error listing: couldn't list files: XML syntax error on line 56: invalid character entity Ã
2021/11/24 09:22:55 Failed to lsd with 2 errors: last error was: couldn't list files: XML syntax error on line 56: invalid character entity Ã

Here the offending part of the XML returned (using curl -X PROPFIND)

    <d:response>
        <d:href>http://127.0.0.1:4443/XXXXXX/Cloud%20Drive/T%C3%A9l%C3%A9versements%20de%20l%27appareil%20photo</d:href>
        <d:propstat>
            <d:status>HTTP/1.1 200 OK</d:status>
            <d:prop>
                <d:displayname>T&Atilde;&copy;l&Atilde;&copy;versements de l&apos;appareil photo</d:displayname>
                <d:creationdate>Sun, 24 Jun 2018 06:38:03 GMT</d:creationdate>
                <d:getlastmodified>Thu, 01 Jan 1970 00:00:00 GMT</d:getlastmodified>
                <d:resourcetype>
                    <d:collection />
                </d:resourcetype>
            </d:prop>
        </d:propstat>
    </d:response>

After digging a little, it seems that XML 1.0 specification rev5 (search Well-formedness constraint: Entity Declared) states that amp, lt, gt, apos and quot are the only predefined entities.

I understand that could cause issue with non-conforming clients.

Please do tell me if I need to open an issue.

CodingKoopa commented 2 years ago

Related to #2599.