[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
This commit is contained in:
Julien Castiaux
2022-11-14 14:20:29 +01:00
parent 2755af8fac
commit 97ee7ae05c
+3 -3
View File
@@ -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
)