You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
line 53 of ext/pyramid/context.py does : if req.body and req.content_type in ("application/json", "application/json-rpc"): json_body = req.json_body # TODO : raise exception if not correct , return 400 if uncorrect instead ? else: json_body = {}
req.body come from pyramid request and is processed by webob.
Problem is, that, checking req.body mean loading data and potentially all request (if you send a 700m file, it will load them in memory).
Simple fix may be if req.content_type in ("application/json", "application/json-rpc") and req.body :
we can also do no try to load body and do a try catch on "req.json_body"
We should later probably return exception in case of empty content but changing the behavior here, mean breaking code (it happened in tracim with case we received are application/json content type with fully empty body, not json parsable)
The text was updated successfully, but these errors were encountered:
line 53 of ext/pyramid/context.py does :
if req.body and req.content_type in ("application/json", "application/json-rpc"): json_body = req.json_body # TODO : raise exception if not correct , return 400 if uncorrect instead ? else: json_body = {}
req.body come from pyramid request and is processed by webob.
Problem is, that, checking req.body mean loading data and potentially all request (if you send a 700m file, it will load them in memory).
Simple fix may be
if req.content_type in ("application/json", "application/json-rpc") and req.body :
we can also do no try to load body and do a try catch on "req.json_body"
We should later probably return exception in case of empty content but changing the behavior here, mean breaking code (it happened in tracim with case we received are application/json content type with fully empty body, not json parsable)
The text was updated successfully, but these errors were encountered: