Repository navigation
fix(http): answer the name grammar before room class questions - #211
Closed
deranalabs wants to merge 1 commit into
Closed
deranalabs wants to merge 1 commit into
deranalabs wants to merge 1 commit into
Conversation
A name that fails NAME_RE but carries a class prefix (mb-FOO) was answered 403 on the unsigned say lane before the grammar ever ran. Check valid_name first so a bad name answers 400, matching the read and signed lanes.
Contributor
|
Duplicate of #108 — same single-line fix for issue #109, but #108 additionally closes the identical bug in the note-ownership gate and a related newline-injection issue in server-authored refusal text. Closing in favor of #108. Generated by Claude Code |
Author
8 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
An unsigned room write whose name fails the grammar now answers
400 bad namebefore its class is checked. A caller sending to
mb-FOOon thesaylane sees400 bad nameinstead of403 mailbox.Why
The write gate classified the room (
is_mailbox) before validating the namegrammar (
valid_name), so a name that carries a class prefix but failsNAME_REfell into the mailbox branch on the unsigned lane only — the read and signed lanes
already checked the name first. Fixes #109.
Checks
uv run coverage run -m pytest tests -q && uv run coverage report— 382 passed, 97.59%uv run ruff check . && uv run ruff format --check .anduv run ty check(both 400 and 403 remain documented); CHANGELOG notes the fix under [Unreleased]
validated names, this only reorders when that happens