Skip to content

Commit

Permalink
Workaround for a new Odoo/werkzeug request restriction
Browse files Browse the repository at this point in the history
Short-term workaround for the problem described here: OCA#414
  • Loading branch information
meestaben authored Feb 19, 2024
1 parent 443b800 commit d4a28a3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion fastapi/fastapi_dispatcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ def _make_response(self, status_mapping, headers_tuple, content):

def _get_environ(self):
environ = self.request.httprequest.environ
environ["wsgi.input"] = self.request.httprequest._get_stream_for_parsing()
wrapped_request = getattr(
self.request.httprequest, "_HTTPRequest__wrapped", None
)
environ["wsgi.input"] = (
wrapped_request._get_stream_for_parsing()
if wrapped_request
else self.request.httprequest._get_stream_for_parsing()
)
return environ

@contextmanager
Expand Down

0 comments on commit d4a28a3

Please sign in to comment.