From 3a081d5cd0fb9de46d36f7d93176256cd6b5253b Mon Sep 17 00:00:00 2001 From: Afreen Misbah Date: Tue, 28 Jul 2026 18:17:56 +0530 Subject: [PATCH] mgr/dashboard: add text/javascript to gzip mime types CherryPy's serve_file() uses Python's mimetypes module which returns text/javascript for .js files (RFC 9239), but the gzip config only listed application/javascript. This meant the main Angular bundle was being served uncompressed. With Cheroot write timeouts, the uncompressed transfer times out over slower networks, causing ERR_CONTENT_LENGTH_MISMATCH in the browser. Signed-off-by: Afreen Misbah --- src/pybind/mgr/dashboard/module.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/pybind/mgr/dashboard/module.py b/src/pybind/mgr/dashboard/module.py index 7b7bb3b77de1..e890e972bd48 100644 --- a/src/pybind/mgr/dashboard/module.py +++ b/src/pybind/mgr/dashboard/module.py @@ -106,7 +106,8 @@ class CherryPyConfig(object): 'tools.gzip.on': True, 'tools.gzip.mime_types': [ 'text/html', 'text/plain', 'application/json', - 'application/*+json', 'application/javascript', 'text/css' + 'application/*+json', 'application/javascript', + 'text/javascript', 'text/css' ], 'tools.json_in.on': True, 'tools.json_in.force': True, -- 2.47.3