diff options
| author | Thanh Dodeur <tso@odoo.com> | 2019-06-11 10:47:31 +0000 |
|---|---|---|
| committer | Thanh Dodeur <tso@odoo.com> | 2019-06-19 12:31:07 +0000 |
| commit | f3e10f698032407f8e6da9abcd37aa224e7c0c1e (patch) | |
| tree | 8280a41eb33508091c0219853621e9b58d0db2eb /addons/web/controllers | |
| parent | 82bf73fe3049978d5fa0b6984e129c5aa2870d95 (diff) | |
[FIX] base, web: set 304 status in binary_content
Before this commit, the No Change status wasn't properly set because
the `filehash` wasn't passed to `_binary_set_headers` and because
the status was not changed to 304 if it was already set to 200 earlier.
This commit fixes this issue and also prevents images to be processed
in `content_image` if the status is 304.
opw-2008426
closes odoo/odoo#34032
Signed-off-by: Christophe Simonis <chs@odoo.com>
Diffstat (limited to 'addons/web/controllers')
| -rw-r--r-- | addons/web/controllers/main.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 040d13aad20..6d382c92333 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1046,7 +1046,7 @@ class Binary(http.Controller): filename_field=filename_field, download=download, mimetype=mimetype, default_mimetype='image/png', access_token=access_token) - if status == 301 or (status != 200 and download): + if status in [301, 304] or (status != 200 and download): return request.env['ir.http']._response_by_status(status, headers, content) if not content: content = base64.b64encode(self.placeholder(image='placeholder.png')) |
