Skip to content

feat: add HandlerAction::response_headers_mut()#36

Open
alukach wants to merge 1 commit into
refactor/simplify-cf-workersfrom
refactor/handler-action-headers
Open

feat: add HandlerAction::response_headers_mut()#36
alukach wants to merge 1 commit into
refactor/simplify-cf-workersfrom
refactor/handler-action-headers

Conversation

@alukach
Copy link
Copy Markdown
Member

@alukach alukach commented Apr 16, 2026

Summary

  • Adds response_headers_mut() method to HandlerAction returning Option<&mut HeaderMap>
  • Returns Some for Response and Forward variants, None for NeedsBody
  • Eliminates the need to match on all three variants when adding response headers in middleware

Test plan

  • cargo test -p multistore — 62 tests pass including 3 new tests for the method

🤖 Generated with Claude Code

…injection

Middleware that adds response headers (CORS, Server-Timing, etc.) no
longer needs to match on all three HandlerAction variants manually.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant