blob: cd917daeb031394471e95051fe454678199d07fa (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from .helper import DashboardTestCase
class RequestsTest(DashboardTestCase):
def test_gzip(self):
self._get('/api/summary')
self.assertHeaders({
'Content-Encoding': 'gzip',
'Content-Type': 'application/json',
})
def test_force_no_gzip(self):
self._get('/api/summary', params=dict(
headers={'Accept-Encoding': 'identity'}
))
self.assertNotIn('Content-Encoding', self._resp.headers)
self.assertHeaders({
'Content-Type': 'application/json',
})
def test_server(self):
self._get('/api/summary')
self.assertHeaders({
'server': 'Ceph-Dashboard',
'Content-Security-Policy': "frame-ancestors 'self';",
'X-Content-Type-Options': 'nosniff',
'Strict-Transport-Security': 'max-age=63072000; includeSubDomains; preload'
})
|