forked from TrueCloudLab/rclone
lib/rest: process HTML entities within XML
MEGAcmd currently includes escaped HTML4 entites in its XML messages. This behavior deviates from the XML standard, but currently it prevents rclone from being able to use the remote.
This commit is contained in:
parent
df09c3f555
commit
0681a5c86a
1 changed files with 4 additions and 0 deletions
|
@ -167,6 +167,10 @@ func DecodeJSON(resp *http.Response, result interface{}) (err error) {
|
|||
func DecodeXML(resp *http.Response, result interface{}) (err error) {
|
||||
defer fs.CheckClose(resp.Body, &err)
|
||||
decoder := xml.NewDecoder(resp.Body)
|
||||
// MEGAcmd has included escaped HTML entities in its XML output, so we have to be able to
|
||||
// decode them.
|
||||
decoder.Strict = false
|
||||
decoder.Entity = xml.HTMLEntity
|
||||
return decoder.Decode(result)
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue