Commit c6f47e2
naarob
fix: mask password in __repr__ (aio-libs#1630), UUID as string in query (aio-libs#1643), split_url delim perf
fix aio-libs#1630: URL.__repr__ exposed passwords in plaintext, risking credential
leakage in logs and tracebacks. Added password masking with '********'.
str(), == and all other operations remain unaffected.
fix aio-libs#1643: uuid.UUID was converted to int in query params because UUID
implements __int__(), matching the SupportsInt protocol. Fixed by checking
whether type(v).__str__ is not object.__str__ before using int() conversion.
This is a general solution that works for any type with a meaningful __str__.
perf: split_url() delimiter search refactored from a for-loop over delim_chars
to 3 conditional find() calls using the already-computed has_hash and
has_question_mark flags. Reduces per-call overhead for URL-heavy workloads.1 parent 148fc70 commit c6f47e2
3 files changed
Lines changed: 24 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | | - | |
55 | | - | |
56 | | - | |
57 | | - | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
58 | 67 | | |
59 | 68 | | |
60 | 69 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
32 | 38 | | |
33 | 39 | | |
34 | 40 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
508 | 508 | | |
509 | 509 | | |
510 | 510 | | |
| 511 | + | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
511 | 515 | | |
512 | 516 | | |
513 | 517 | | |
| |||
1490 | 1494 | | |
1491 | 1495 | | |
1492 | 1496 | | |
1493 | | - | |
| 1497 | + | |
1494 | 1498 | | |
1495 | 1499 | | |
1496 | 1500 | | |
| |||
0 commit comments