[FIX] base: reason json payload using get_data
Replace `httprequest.stream.read()` by `httprequest.get_data()` so the payload content remains available: get_data stores the request body (by default) so it remains available for alternative processing or checks (MAC checks for webhook validations for instance). With `stream.read()`, once the data is read if it's not stored separately it is lost.
This commit is contained in:
committed by
xmo-odoo
parent
7a2cba3c89
commit
ff07f078fa
@@ -9,3 +9,4 @@ declaration.
|
||||
Signed,
|
||||
|
||||
Kiril Vangelovski kiril@hacbee.com https://github.com/kirca
|
||||
Kiril Vangelovski kiril@lambda-is.com https://github.com/kirca
|
||||
|
||||
+1
-1
@@ -603,7 +603,7 @@ class JsonRequest(WebRequest):
|
||||
request = self.session.pop('jsonp_request_%s' % (request_id,), '{}')
|
||||
else:
|
||||
# regular jsonrpc2
|
||||
request = self.httprequest.stream.read().decode(self.httprequest.charset)
|
||||
request = self.httprequest.get_data().decode(self.httprequest.charset)
|
||||
|
||||
# Read POST content or POST Form Data named "request"
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user