Skip to content
Snippets Groups Projects
Commit 740c7c61 authored by Julien (jula)'s avatar Julien (jula) Committed by Julien Castiaux
Browse files

[FIX] web, stock: escape JSON error when downloading report


__Description of the issue:__

When something goes wrong while downloading a report file, a 500 error
is sent as JSON. However the frontend interprets this response as HTML
and then try to parse the text content as JSON.

Most of the time this works, but if the response contains any HTML tags,
like `<lambda>` from a Python stacktrace, the JSON response will get
misinterpreted as HTML instead of regular text, causing the subsequent
JSON interpretation to fail.

The end result for the user is that empty tracebacks will be displayed
instead of User Errors or actual tracebacks.

__Desired behavior:__

The JSON response is HTML escaped before being sent and will therefore
be correctly parsed and displayed to the user.

This basically restore what was done prior of #104594.

closes odoo/odoo#111433

Enterprise: odoo/enterprise#36523
Signed-off-by: default avatarJulien Castiaux <juc@odoo.com>
parent f7582195
Branches
Tags
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment