aboutsummaryrefslogtreecommitdiffstats
path: root/tests/test_redact.py
diff options
context:
space:
mode:
Diffstat (limited to 'tests/test_redact.py')
-rw-r--r--tests/test_redact.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/tests/test_redact.py b/tests/test_redact.py
index 23c2a45..e6d65c0 100644
--- a/tests/test_redact.py
+++ b/tests/test_redact.py
@@ -51,6 +51,20 @@ class TestRedactUrl(unittest.TestCase):
"http://a.example.invalid/p?t=REDACTED&t=REDACTED",
)
+ def test_a_valueless_token_is_redacted_whole(self):
+ # parse_qsl reads ?victim@example.org as a NAME, and names are kept.
+ # A token with no "=" is a value, not a fingerprint.
+ self.assertEqual(
+ redact.url("http://a.invalid/p?victim@example.org"),
+ "http://a.invalid/p?REDACTED",
+ )
+
+ def test_a_valueless_token_in_a_fragment_is_redacted_whole(self):
+ self.assertEqual(
+ redact.url("http://a.invalid/p#victim@example.org"),
+ "http://a.invalid/p#REDACTED",
+ )
+
class TestSuspectPathSegments(unittest.TestCase):
def test_a_base64_looking_segment_is_flagged(self):