Skip to content

Enforce ASCII channel and group names - #2235

Open
zhechen-cs wants to merge 1 commit into
django:mainfrom
zhechen-cs:codex/validate-ascii-channel-names
Open

zhechen-cs wants to merge 1 commit into
django:mainfrom
zhechen-cs:codex/validate-ascii-channel-names

Conversation

@zhechen-cs

Copy link
Copy Markdown

Channel and group names are documented as ASCII-only, but the validation regexes use Unicode \d and \w. They accept names such as chat١, and the process-specific suffix also accepts specific!é. The $ anchor accepts a trailing newline as well.

Use explicit ASCII ranges and a strict end-of-string anchor. Regression tests cover Unicode digits, non-ASCII local suffixes, trailing newlines, and valid ASCII names including process-specific channels.

Validation: tests/test_layers.py (28 passed); suite excluding the two Selenium tests (93 passed); flake8, black, isort and diff checks passed. The Selenium group is unstable on the unmodified upstream checkout too: a full baseline run had 81 passed and one WebSocket connection timeout; both browser tests passed when run alone.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant