Skip to content

caddyhttp: fix randString sameCase dictionary to match its docs - #7972

Merged
mholt merged 7 commits into
masterfrom
fix-rand-string-same-case-dict
Sep 25, 2026
Merged

mholt merged 7 commits into
masterfrom
fix-rand-string-same-case-dict

Conversation

@mohammed90

Copy link
Copy Markdown
Member

The doc comment says randString excludes confusing characters like I, l, 1, 0, O. When sameCase is true, uppercase letters and the characters l and o should be excluded. But the sameCase dictionary still contained '0'. Drop it.

Assistance Disclosure

Test was generated by copilot/Claude 4.7; fixed by the same.

Related to #7227

The doc comment says randString excludes confusing characters like
I, l, 1, 0, O. When sameCase is true, uppercase letters and the
characters l and o should be excluded. But the sameCase dictionary
still contained '0'. Drop it.

Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
@mohammed90 mohammed90 added the bug 🐞 Something isn't working label Aug 30, 2026
@steadytao steadytao added this to the v2.11.5 milestone Sep 2, 2026
Comment thread modules/caddyhttp/errors.go Resolved

@mholt mholt left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but yeah we could just drop the 1.

Comment thread modules/caddyhttp/errors.go Resolved
mholt and others added 3 commits September 24, 2026 14:29
Signed-off-by: Matt Holt <mholt@users.noreply.github.com>
Signed-off-by: Mohammed Al Sahaf <msaa1990@gmail.com>
@mohammed90

Copy link
Copy Markdown
Member Author

I've expanded the doc and the tests

@steadytao steadytao left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than small typo, happy!

Co-authored-by: Zen Dodd <mail@steadytao.com>
Signed-off-by: Mohammed Al Sahaf <mohammed@caffeinatedwonders.com>
@steadytao
steadytao requested a review from mholt September 25, 2026 10:08
@mholt
mholt enabled auto-merge (squash) September 25, 2026 15:53
@mholt
mholt merged commit 5493791 into master Sep 25, 2026
31 checks passed
@mholt
mholt deleted the fix-rand-string-same-case-dict branch September 25, 2026 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug 🐞 Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants