fix(capture): remove empty URL userinfo markers

This commit is contained in:
Morluto
2026-10-14 02:14:51 +08:00
parent 29c871e51b
commit 2c6e074cac
2 changed files with 6 additions and 1 deletions
+5
View File
@@ -134,6 +134,11 @@ class TransportUserinfoTests(unittest.TestCase):
text, _sidecar, _redactions = location(b"https://user:pw@example.test/a@b")
self.assertEqual(text, "https://example.test/a@b")
def test_empty_userinfo_marker_is_removed(self):
self.assertEqual(
capture.without_userinfo("https://@host"), "https://host"
)
def test_special_schemes_skip_leading_slashes_before_userinfo(self):
for value, expected in [
(b"https://\\user:pass@host/path", b"https://\\host/path"),