[18.0][FIX] ai_oca_bridge: avoid crash when request charset is missing#64
Conversation
|
squash your commits please |
7c9977c to
c6d7ec7
Compare
|
Hi @etobella, thanks for the review and approval. I have squashed the branch as requested: Rebased on the latest OCA/ai 18.0 Thanks again |
|
This PR has the |
|
/ocabot merge patch |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 726323c. Thanks a lot for contributing to OCA. ❤️ |
Problem
The async callback endpoint
/ai/response/<execution_id>/<token>decodes the raw request body withrequest.httprequest.charset.In some environments, the wrapped request object does not expose a
charsetattribute, which causes the callback to crash with:As a result, valid async callback payloads return HTTP 500 before
_process_response()is reached.Reproduction
A direct callback request also fails with HTTP 500:
Fix
Use a safe fallback to UTF-8 when the request object does not provide a charset:
Result
Async callback payloads such as:
{"body":"Record updated successfully"}can be processed without crashing when
request.httprequest.charsetis missing.Additional context
Possibly fixes issue #54