]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
This commit is intended to hide CherryPy name and version, from HTTP header 'Server... 39419/head
authoranurag <anurag@localhost.localdomain>
Mon, 20 Apr 2020 23:13:07 +0000 (04:43 +0530)
committerErnesto Puerta <epuertat@redhat.com>
Thu, 11 Feb 2021 14:52:19 +0000 (15:52 +0100)
Fixes: <https://tracker.ceph.com/issues/44935>
Signed-off-by: anurag <abandhu@redhat.com>
(cherry picked from commit 6fea0f2ce861360643b86774fd86391b781c3789)

qa/tasks/mgr/dashboard/test_requests.py
src/pybind/mgr/dashboard/services/auth.py

index 0d9f8d9ba83697042c63c18f4b0c1bbc30bd8b0f..25460914866ad21c96e864f7724b4b04476ae74f 100644 (file)
@@ -21,3 +21,9 @@ class RequestsTest(DashboardTestCase):
         self.assertHeaders({
             'Content-Type': 'application/json',
         })
+
+    def test_server(self):
+        self._get('/api/summary')
+        self.assertHeaders({
+            'server': 'Ceph-Dashboard'
+        })
\ No newline at end of file
index be5967394d1e946a1a5864f4852f6a4770479eb2..12cd6978dc8dd9ce5bc1da7c81e0a5195dcc05e2 100644 (file)
@@ -14,6 +14,10 @@ import jwt
 from .access_control import LocalAuthenticator, UserDoesNotExist
 from .. import mgr, logger
 
+cherrypy.config.update({
+    'response.headers.server': 'Ceph-Dashboard'
+    })
+
 
 class JwtManager(object):
     JWT_TOKEN_BLACKLIST_KEY = "jwt_token_black_list"