From 54da6e2ac20bde80e0de9e35aa0c40ae1dd13943 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Fri, 23 Apr 2021 08:59:35 -0400 Subject: Fixed #32678 -- Removed SECURE_BROWSER_XSS_FILTER setting. --- tests/middleware/test_security.py | 28 ---------------------------- 1 file changed, 28 deletions(-) (limited to 'tests/middleware') diff --git a/tests/middleware/test_security.py b/tests/middleware/test_security.py index 1b7434c9a8..49432fbc8a 100644 --- a/tests/middleware/test_security.py +++ b/tests/middleware/test_security.py @@ -175,34 +175,6 @@ class SecurityMiddlewareTest(SimpleTestCase): """ self.assertNotIn('X-Content-Type-Options', self.process_response().headers) - @override_settings(SECURE_BROWSER_XSS_FILTER=True) - def test_xss_filter_on(self): - """ - With SECURE_BROWSER_XSS_FILTER set to True, the middleware adds - "s-xss-protection: 1; mode=block" header to the response. - """ - self.assertEqual( - self.process_response().headers['X-XSS-Protection'], - '1; mode=block', - ) - - @override_settings(SECURE_BROWSER_XSS_FILTER=True) - def test_xss_filter_already_present(self): - """ - The middleware will not override an "X-XSS-Protection" header - already present in the response. - """ - response = self.process_response(secure=True, headers={"X-XSS-Protection": "foo"}) - self.assertEqual(response.headers["X-XSS-Protection"], "foo") - - @override_settings(SECURE_BROWSER_XSS_FILTER=False) - def test_xss_filter_off(self): - """ - With SECURE_BROWSER_XSS_FILTER set to False, the middleware does not - add an "X-XSS-Protection" header to the response. - """ - self.assertNotIn('X-XSS-Protection', self.process_response().headers) - @override_settings(SECURE_SSL_REDIRECT=True) def test_ssl_redirect_on(self): """ -- cgit v1.2.1