[tor-commits] [bridgedb/develop] Preserve HTTP POST args across redirects.

isis at torproject.org isis at torproject.org
Sat Feb 1 23:57:39 UTC 2014


commit 458e490881e96069642ceaffe9f2ce8c5f251cd8
Author: Isis Lovecruft <isis at torproject.org>
Date:   Sun Jan 26 04:26:06 2014 +0000

    Preserve HTTP POST args across redirects.
    
     * FIXES #10737, an issue where if a CAPTCHA was entered incorrectly, the
       client would be redirected back to /bridges.html without the original HTTP
       POST arguments (which specify the requested pluggable transports, IP
       version, etc.).
---
 lib/bridgedb/HTTPServer.py |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/bridgedb/HTTPServer.py b/lib/bridgedb/HTTPServer.py
index 5ce8b72..ddb1812 100644
--- a/lib/bridgedb/HTTPServer.py
+++ b/lib/bridgedb/HTTPServer.py
@@ -145,7 +145,10 @@ class CaptchaProtectedResource(twisted.web.resource.Resource):
                          % (remote_ip, request.args))
             logging.info("Recaptcha error code: %r"
                          % recaptcha_response.error_code)
-        return redirectTo(request.URLPath(), request)
+
+        logging.debug("Client failed a recaptcha; returning redirect to %s"
+                      % request.uri)
+        return redirectTo(request.uri, request)
 
 class WebResource(twisted.web.resource.Resource):
     """This resource is used by Twisted Web to give a web page with some





More information about the tor-commits mailing list