diff options
| author | Nicolas Martinelli <nim@odoo.com> | 2020-02-11 12:41:15 +0000 |
|---|---|---|
| committer | Nicolas Martinelli <nim@odoo.com> | 2020-02-12 09:56:12 +0000 |
| commit | a02e426669119d6c633dce5186ea06e8578989a2 (patch) | |
| tree | 696758e44775854c139e63a56c79ac993dbffde3 /addons/web/controllers | |
| parent | d4808210bd081660cc5772f1ffb6102d584407c4 (diff) | |
[FIX] web: 404 response even if placeholder
- Open any product kanban view with missing images
A 404 status code is returned for missing images, while they are
replaced by a placeholder.
This can cause issues when configuring a specific 404 page in a reverse
proxy: the proxy will serve the custom page instead of the placeholder.
opw-2192663
opw-2192340
closes odoo/odoo#45157
X-original-commit: 2719c8a0e40f318787b4d7a46626de46a8fd33f0
Signed-off-by: Nicolas Martinelli (nim) <nim@odoo.com>
Diffstat (limited to 'addons/web/controllers')
| -rw-r--r-- | addons/web/controllers/main.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index cdc43a07c6e..1fece767a0d 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1464,6 +1464,10 @@ class Binary(http.Controller): placeholder_content = Binary.placeholder(image=placeholder_filename) else: placeholder_content = Binary.placeholder() + # Since we set a placeholder for any missing image, the status must be 200. In case one + # wants to configure a specific 404 page (e.g. though nginx), a 404 status will cause + # troubles. + status = 200 image_base64 = base64.b64encode(placeholder_content) if not (width or height): |
