Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix middleware header example #358

Merged
merged 1 commit into from
Apr 8, 2024

Conversation

danielgtaylor
Copy link
Owner

Small documentation fix - you cannot set headers after the body has already been written. A more advanced middleware could capture the body in memory before setting a header, but that is beyond the scope of this example.

Fixes #355.

@danielgtaylor danielgtaylor marked this pull request as ready for review April 8, 2024 04:36
@danielgtaylor danielgtaylor merged commit 6247e82 into main Apr 8, 2024
3 checks passed
@danielgtaylor danielgtaylor deleted the fix-middleware-header-example branch April 8, 2024 04:39
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.

Router-agnostic middleware example does not set response header as expected
1 participant