diff --git a/fastapi/fastapi_dispatcher.py b/fastapi/fastapi_dispatcher.py index a78e3f816..be97fdc39 100644 --- a/fastapi/fastapi_dispatcher.py +++ b/fastapi/fastapi_dispatcher.py @@ -20,7 +20,7 @@ def dispatch(self, endpoint, args): # don't parse the httprequest let starlette parse the stream self.request.params = {} # dict(self.request.get_http_params(), **args) environ = self._get_environ() - root_path = "/" + environ["PATH_INFO"].split("/")[1] + root_path = "/".join(environ["PATH_INFO"].split("/")[0:-1]) # TODO store the env into contextvar to be used by the odoo_env # depends method fastapi_endpoint = self.request.env["fastapi.endpoint"].sudo()