Skip to content

perf(dispatch): fast-fail 404/405 before body read - #81

Merged
ZhuchkaTriplesix merged 2 commits into
devfrom
issue-71-dispatch-fast-fail-before-body-read
Apr 27, 2026
Merged

ZhuchkaTriplesix merged 2 commits into
devfrom
issue-71-dispatch-fast-fail-before-body-read

Conversation

@ZhuchkaTriplesix

Copy link
Copy Markdown
Member

Summary

  • move route/method resolution ahead of protocol body read in Rust dispatcher
  • return 404/405 early for non-matching requests without consuming body
  • add probe tests that assert 404/405 paths do not call protocol body reader

Test plan

  • uv run pytest tests/test_dispatch_fast_fail.py tests/test_405.py
  • uv run pytest

Closes #71

Resolve route and method before consuming request body so invalid path/method traffic returns early and avoids unnecessary buffering work.
Add RSGI probe tests that assert protocol body reads are not triggered for 404 and 405 responses, protecting the new fast-fail behavior.

@ZhuchkaTriplesix ZhuchkaTriplesix left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

123

@ZhuchkaTriplesix
ZhuchkaTriplesix merged commit f2d73a6 into dev Apr 27, 2026
16 checks passed
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.

perf(dispatch): route/method decision before full body read for 404/405 fast-fail

1 participant