From: Patrick Nawracay Date: Thu, 25 Jan 2018 18:47:43 +0000 (+0100) Subject: mgr/dashboard_v2: Fix content type of JSON responses X-Git-Tag: v13.0.2~84^2~113 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c866b73377c96334c56e36d0cd2db8314d1ecef8;p=ceph.git mgr/dashboard_v2: Fix content type of JSON responses Signed-off-by: Patrick Nawracay --- diff --git a/src/pybind/mgr/dashboard_v2/tools.py b/src/pybind/mgr/dashboard_v2/tools.py index aadb96b8d7ff..2f42e24e7660 100644 --- a/src/pybind/mgr/dashboard_v2/tools.py +++ b/src/pybind/mgr/dashboard_v2/tools.py @@ -249,8 +249,7 @@ class RESTController(BaseController): @staticmethod def _returns_json(func): def inner(*args, **kwargs): - cherrypy.serving.response.headers['Content-Type'] = \ - 'application/json' + cherrypy.response.headers['Content-Type'] = 'application/json' ret = func(*args, **kwargs) return json.dumps(ret).encode('utf8') return inner