def METHOD_NAME(self):
    # Remote HTTP connection is always redirected to HTTPS
    request = forge_request(uri=b'http://www.globaleaks.org/')
    self.api.render(request)
    self.assertFalse(request.client_using_tor)
    self.assertEqual(request.responseCode, 302)
    # Local HTTP connection on port 8082 should be marked as not coming from Tor
    request = forge_request(uri=b'http://127.0.0.1:8082/', client_addr=IPv4Address('TCP', '127.0.0.1', 12345))
    self.api.render(request)
    self.assertFalse(request.client_using_tor)
    self.assertEqual(request.responseCode, 302)
    # Local HTTP connection on port 8083 should be marked as coming from Tor
    request = forge_request(uri=b'http://127.0.0.1:8083/', client_addr=IPv4Address('TCP', '127.0.0.1', 12345))
    self.api.render(request)
    self.assertTrue(request.client_using_tor)
    self.assertEqual(request.responseCode, 302)
    # Remote HTTP connection not coming from Tor should be redirected to HTTPS
    request = forge_request(uri=b'http://www.globaleaks.org/', client_addr=IPv4Address('TCP', '8.8.8.8', 12345))
    self.api.render(request)
    self.assertFalse(request.client_using_tor)
    self.assertEqual(request.responseCode, 302)
    self.assertEqual(request.responseHeaders.getRawHeaders('location')[0], 'https://www.globaleaks.org/')