[tor-commits] [ooni-probe/master] Inject the correct url when following redirects

art at torproject.org art at torproject.org
Mon May 30 16:28:34 UTC 2016


commit 6380468033cd7cca542184ebe8d2b4148aaec2b7
Author: Arturo Filastò <arturo at filasto.net>
Date:   Tue May 24 18:25:40 2016 +0200

    Inject the correct url when following redirects
---
 ooni/templates/httpt.py | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/ooni/templates/httpt.py b/ooni/templates/httpt.py
index ca0306b..6e0154c 100644
--- a/ooni/templates/httpt.py
+++ b/ooni/templates/httpt.py
@@ -196,6 +196,9 @@ class HTTPTest(NetTestCase):
             if (config.privacy.includeip is False and config.probe_ip.address is not None and
                     (isinstance(response_body, str) or isinstance(response_body, unicode))):
                 response_body = response_body.replace(config.probe_ip.address, "[REDACTED]")
+            if (getattr(response, 'request', None) and
+                    getattr(response.request, 'absoluteURI', None)):
+                session['request']['url'] = response.request.absoluteURI
             session['response'] = {
                 'headers': _representHeaders(response.headers),
                 'body': response_body,





More information about the tor-commits mailing list