[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

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



commit 6380468033cd7cca542184ebe8d2b4148aaec2b7
Author: Arturo Filastò <arturo@xxxxxxxxxxx>
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,



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits