self._get('/api/summary')
self.assertHeaders({
'server': 'Ceph-Dashboard',
- 'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION)
+ 'Content-Type': 'application/vnd.ceph.api.v{}+json'.format(DEFAULT_VERSION),
+ 'Content-Security-Policy': "frame-ancestors 'self';",
+ 'X-Content-Type-Options': 'nosniff',
+ 'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload'
})
r = requests.get(original_uri + "metrics", allow_redirects=False)
self.assertEqual(r.status_code, 200)
self.assertEqual(r.headers["content-type"], "text/plain;charset=utf-8")
+ self.assertEqual(r.headers["server"], "Ceph-Prometheus")
def test_urls(self):
self._assign_ports("prometheus", "server_port")
from .access_control import LocalAuthenticator, UserDoesNotExist
cherrypy.config.update({
- 'response.headers.server': 'Ceph-Dashboard'
+ 'response.headers.server': 'Ceph-Dashboard',
+ 'response.headers.content-security-policy': "frame-ancestors 'self';",
+ 'response.headers.x-content-type-options': 'nosniff',
+ 'response.headers.strict-transport-security': 'max-age=63072000; includeSubDomains; preload'
})
# it's a dict, the writer doesn't need to declare 'global' for access
_global_instance = None # type: Optional[Module]
+cherrypy.config.update({
+ 'response.headers.server': 'Ceph-Prometheus'
+})
def health_status_to_number(status):