From 97ee7ae05c35e683130fed7add11992c0b0d146a Mon Sep 17 00:00:00 2001 From: Julien Castiaux Date: Tue, 6 Sep 2022 15:13:53 +0000 Subject: [PATCH] [IMP] hw_drivers: use clever HTTP cache for logs `odoo.http.send_file` is deprecrated, `odoo.http.Stream` using the `from_path` constructor is a drop-in replacement. Part-of: odoo/odoo#99658 --- addons/hw_drivers/controllers/driver.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/addons/hw_drivers/controllers/driver.py b/addons/hw_drivers/controllers/driver.py index acc8eeaa474..3cf12a81d2d 100755 --- a/addons/hw_drivers/controllers/driver.py +++ b/addons/hw_drivers/controllers/driver.py @@ -101,6 +101,6 @@ class DriverController(http.Controller): Downloads the log file """ if tools.config['logfile']: - res = http.send_file(tools.config['logfile'], mimetype="text/plain", as_attachment=True) - res.headers['Cache-Control'] = 'no-cache' - return res + return http.Stream.from_path(tools.config['logfile']).get_response( + mimetype='text/plain', as_attachment=True + )