From 9ec75945689c4c6c617a73f0966ecf6a67caed53 Mon Sep 17 00:00:00 2001 From: Xavier-Do <xdo@odoo.com> Date: Mon, 25 Apr 2022 10:01:40 +0000 Subject: [PATCH] [FIX] http, web: use Response instead of BaseResponse Part-of: odoo/odoo#98081 --- addons/web/controllers/main.py | 3 +-- odoo/http.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/addons/web/controllers/main.py b/addons/web/controllers/main.py index 813a0d941d84..cdd8daacd44f 100644 --- a/addons/web/controllers/main.py +++ b/addons/web/controllers/main.py @@ -1099,10 +1099,9 @@ class Proxy(http.Controller): if not data: raise werkzeug.exceptions.BadRequest() from werkzeug.test import Client - from werkzeug.wrappers import BaseResponse base_url = request.httprequest.base_url query_string = request.httprequest.query_string - client = Client(http.root, BaseResponse) + client = Client(http.root, werkzeug.wrappers.Response) headers = {'X-Openerp-Session-Id': request.session.sid} return client.post('/' + path, base_url=base_url, query_string=query_string, headers=headers, data=data) diff --git a/odoo/http.py b/odoo/http.py index bae72737196a..5536daedc15f 100644 --- a/odoo/http.py +++ b/odoo/http.py @@ -539,7 +539,7 @@ def route(route=None, **kw): if isinstance(response, werkzeug.exceptions.HTTPException): response = response.get_response(request.httprequest.environ) - if isinstance(response, werkzeug.wrappers.BaseResponse): + if isinstance(response, werkzeug.wrappers.Response): response = Response.force_type(response) response.set_default() return response @@ -1453,7 +1453,7 @@ class Root(object): def set_csp(self, response): # ignore HTTP errors - if not isinstance(response, werkzeug.wrappers.BaseResponse): + if not isinstance(response, werkzeug.wrappers.Response): return headers = response.headers -- GitLab