Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[FIX] web: Fix download.js handling of large content.
When handling a non-200 reponse with a large payload (>65536 bytes), download.js fails to decode the payload properly on WebKit. This is because the content is parsed using WebKit's `DOMParser.parseFromString`, which creates several Text nodes if the text would exceed 65536 bytes. Then, only the textContent of the second Text node is passed to `JSON.parse()`, which fails because it is not valid JSON. See https://stackoverflow.com/questions/67738121/in-what-cases-do-browsers-create-multiple-adjacent-text-nodes/67774415#67774415 and https://github.com/WebKit/WebKit/blob/68ae0fde5f959e056fbd6700f1ca7fa652cd1ffa/Source/WebCore/html/parser/HTMLConstructionSite.cpp#L584-L592 closes odoo#160815 Taskid: 3790302 X-original-commit: a68348f Signed-off-by: Luca Vitali (luvi) <[email protected]>
- Loading branch information