From b9c70277d4024f3451fdee5e6313225ae76b5c3c Mon Sep 17 00:00:00 2001 From: Peter Clark Date: Tue, 16 Apr 2024 09:44:58 +0100 Subject: [PATCH] [FIX][DM-562] Allow JSON GET request to not specify body * Odoo assumes JSON body is set for any JSON requests, including GET requests where this is not needed. By setting the body to an empty dictionary if not set we avoid the need for external systems to do this. --- odoo/http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/odoo/http.py b/odoo/http.py index 3c3d7d2c0ed1b..f40a7048c280c 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -610,7 +610,7 @@ def handler(): # Read POST content or POST Form Data named "request" try: - self.jsonrequest = json.loads(request) + self.jsonrequest = json.loads(request) if request else json.loads('{}') except ValueError: msg = 'Invalid JSON data: %r' % (request,) _logger.info('%s: %s', self.httprequest.path, msg)