ad74a829df955c6517a0e12e2df1122629888fed
When attempting to resize or crop an attachment through the '/web/image' route, if the attachment isn't actually an image (even if the record's mimetype says so) or doesn't match one of the format supported by PIL (Python Imaging Library) - like Apple's HEIF - the request crashes with a "500 Internal Error". Although it makes sense to return a response with an HTTP error code, a more sensible approach would be to return a "404 Not Found" response instead. The point by handling the Exception thrown by PIL and returning a 404 status code is to more closely match the semantic of this HTTP status code. Getting a resized version of a non-image doesn't really make sense as this resource doesn't exist at all ; hence the "404 Not Found" response. On the other hand returning a "500 Internal Error" would denote that a legitimate request failed on the server side, which is not the case here. Note: this difference of semantic, even if only visible in a regular browser, has its importance in the mobile apps because we use it to given a meaningful feedback to the user in case if failed HTTP requests. Note: the mimetype detection could be improved to ease the handling of this kind of errors but would require too much changes to be done in stable branch. Steps to reproduce in Discuss: - rename an HEIF file with a ".jpeg" extension - upload it in a chat window => the thumbnail in the chat window throws an HTTP error 500 opw-2417172 closes odoo/odoo#63772 X-original-commit: 873bc2aa5a8fcfc0664fc5ca70f789911873d583 Related: odoo/enterprise#15462 Signed-off-by: Pierre Paridans <pparidans@users.noreply.github.com> Signed-off-by: Adrien Dieudonné (adr) <adr@odoo.com>
…
…
…
Odoo
Odoo is a suite of web based open source business apps.
The main Odoo Apps include an Open Source CRM, Website Builder, eCommerce, Warehouse Management, Project Management, Billing & Accounting, Point of Sale, Human Resources, Marketing, Manufacturing, ...
Odoo Apps can be used as stand-alone applications, but they also integrate seamlessly so you get a full-featured Open Source ERP when you install several Apps.
Getting started with Odoo
For a standard installation please follow the Setup instructions from the documentation.
To learn the software, we recommend the Odoo eLearning, or Scale-up, the business game. Developers can start with the developer tutorials
Languages
Python
49.6%
JavaScript
47.8%
SCSS
2%
CSS
0.3%
HTML
0.2%