Esempio n. 1
0
 def test_proxy_invalid(self):
     request = HttpRequest()
     request.META['REMOTE_ADDR'] = '1.2.3.4'
     request.META['HTTP_X_FORWARDED_FOR'] = '2.3.4'
     middleware = ProxyMiddleware(self.get_response)
     self.assertEqual(middleware(request), 'response')
Esempio n. 2
0
 def test_proxy_invalid(self):
     request = HttpRequest()
     request.META["REMOTE_ADDR"] = "1.2.3.4"
     request.META["HTTP_X_FORWARDED_FOR"] = "2.3.4"
     middleware = ProxyMiddleware(self.get_response)
     self.assertEqual(middleware(request), "response")
Esempio n. 3
0
 def test_direct(self):
     request = HttpRequest()
     request.META['REMOTE_ADDR'] = '1.2.3.4'
     middleware = ProxyMiddleware(self.get_response)
     self.assertEqual(middleware(request), 'response')
Esempio n. 4
0
 def test_direct(self):
     request = HttpRequest()
     request.META["REMOTE_ADDR"] = "1.2.3.4"
     middleware = ProxyMiddleware(self.get_response)
     self.assertEqual(middleware(request), "response")