[tor-commits] [bridgedb/develop] Use GimpCaptchProtectedResources in HTTPServer.addServer(), if configured to do so.

isis at torproject.org isis at torproject.org
Sun Mar 16 16:38:45 UTC 2014


commit b4af348a3b651b71c7a5a276b8bdb11a9df77a58
Author: Isis Lovecruft <isis at torproject.org>
Date:   Tue Mar 4 08:37:47 2014 +0000

    Use GimpCaptchProtectedResources in HTTPServer.addServer(), if configured to do so.
---
 lib/bridgedb/HTTPServer.py |    8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index 8b65fa6..9411ec1 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -698,13 +698,19 @@ def addWebServer(cfg, dist, sched):
                    includeFingerprints=cfg.HTTPS_INCLUDE_FINGERPRINTS)
 
     if cfg.RECAPTCHA_ENABLED:
-        protected = CaptchaProtectedResource(
+        protected = ReCaptchaProtectedResource(
                 recaptchaPrivKey=cfg.RECAPTCHA_PRIV_KEY,
                 recaptchaPubKey=cfg.RECAPTCHA_PUB_KEY,
                 remoteip=cfg.RECAPTCHA_REMOTEIP,
                 useForwardedHeader=cfg.HTTP_USE_IP_FROM_FORWARDED_HEADER,
                 resource=resource)
         httpdist.putChild('bridges', protected)
+    elif cfg.GIMP_CAPTCHA_ENABLED:
+        protected = GimpCaptchaProtectedResource(
+            captchaDir=cfg.GIMP_CAPTCHA_DIR,
+            useForwardedHeader=cfg.HTTP_USE_IP_FROM_FORWARDED_HEADER,
+            resource=resource)
+        httpdist.putChild('bridges', protected)
     else:
         httpdist.putChild('bridges', resource)
 





More information about the tor-commits mailing list