Commit 7846d7c
Fix token generation infinite loop bug
Extract alphanumeric characters only when replacing leading/trailing
hyphens in generatePortToken(). Previous implementation could randomly
select hyphens when trying to remove them, causing potential infinite
loops.
- Only select from alphanumeric chars when fixing hyphen positions
- Add edge case handling for all-hyphen tokens (regenerate)
- Ensures RFC 952/1123 DNS hostname compliance
Co-authored-by: whoiskatrin <whoiskatrin@users.noreply.github.com>1 parent cf54f93 commit 7846d7c
1 file changed
+11
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1679 | 1679 | | |
1680 | 1680 | | |
1681 | 1681 | | |
1682 | | - | |
| 1682 | + | |
| 1683 | + | |
| 1684 | + | |
| 1685 | + | |
| 1686 | + | |
| 1687 | + | |
| 1688 | + | |
1683 | 1689 | | |
1684 | | - | |
| 1690 | + | |
| 1691 | + | |
1685 | 1692 | | |
1686 | 1693 | | |
1687 | | - | |
1688 | 1694 | | |
1689 | | - | |
| 1695 | + | |
| 1696 | + | |
1690 | 1697 | | |
1691 | 1698 | | |
1692 | 1699 | | |
| |||
0 commit comments