mirror of
https://gitlab.com/flectra-hq/flectra.git
synced 2026-08-18 17:24:42 -05:00
[PATCH] Upstream patch - 13022024
This commit is contained in:
@@ -19,7 +19,7 @@ import flectra
|
||||
from flectra import api, models, registry, exceptions, tools, http
|
||||
from flectra.addons.base.models.ir_http import RequestUID, ModelConverter
|
||||
from flectra.addons.base.models.qweb import QWebException
|
||||
from flectra.http import request
|
||||
from flectra.http import request, HTTPRequest
|
||||
from flectra.osv import expression
|
||||
from flectra.tools import config, ustr, pycompat
|
||||
|
||||
@@ -530,16 +530,8 @@ class IrHttp(models.AbstractModel):
|
||||
request.rerouting.append(path)
|
||||
if len(request.rerouting) > cls.rerouting_limit:
|
||||
raise Exception("Rerouting limit exceeded")
|
||||
request.httprequest.environ['PATH_INFO'] = path
|
||||
# void werkzeug cached_property. TODO: find a proper way to do this
|
||||
for key in ('full_path', 'url', 'base_url'):
|
||||
request.httprequest.__dict__.pop(key, None)
|
||||
# since werkzeug 2.0 `path`` became an attribute and is not a cached property anymore
|
||||
if hasattr(type(request.httprequest), 'path'): # cached property
|
||||
request.httprequest.__dict__.pop('path', None)
|
||||
else: # direct attribute
|
||||
request.httprequest.path = '/' + path.lstrip('/')
|
||||
|
||||
environ = dict(request.httprequest._HTTPRequest__environ, PATH_INFO=path)
|
||||
request.httprequest = HTTPRequest(environ)
|
||||
return cls._dispatch()
|
||||
|
||||
@classmethod
|
||||
|
||||
Reference in New Issue
Block a user