Exemple #1
0
    def test_middleware_after_security_middleware(self):
        middleware = MakeXSSFilterChromeSafeMiddleware()
        request = None  # ignored
        response = {"x-xss-protection": "1; mode=block"}  # "mock" header dict

        response = middleware.process_response(request, response)
        self.assertEqual(response["x-xss-protection"], "0")
Exemple #2
0
    def test_middleware_after_security_middleware(self):
        middleware = MakeXSSFilterChromeSafeMiddleware()
        request = None  # ignored
        response = {"x-xss-protection": "1; mode=block"}  # "mock" header dict

        response = middleware.process_response(request, response)
        self.assertEqual(response["x-xss-protection"], "0")
Exemple #3
0
    def test_middleware_after_security_middleware(self):
        middleware = MakeXSSFilterChromeSafeMiddleware(
            lambda request: {"x-xss-protection": "1; mode=block"})
        request = None  # ignored

        response = middleware(request)
        self.assertEqual(response["x-xss-protection"], "0")
Exemple #4
0
    def test_middleware_before_security_middleware(self):
        middleware = MakeXSSFilterChromeSafeMiddleware(
            lambda request: {"request": request})
        request = None  # ignored

        response = middleware(request)
        self.assertEqual(response["x-xss-protection"], "0")