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

fix: handling http response headers #106

Merged
merged 3 commits into from
Dec 23, 2024
Merged

fix: handling http response headers #106

merged 3 commits into from
Dec 23, 2024

Conversation

lazarv
Copy link
Owner

@lazarv lazarv commented Dec 19, 2024

Moves route matching and route component loading into middleware when using the file-system based router to remove async implementation in the React Server Component entrypoint of the router.

Changes RSC payload handling to use the same approach as in the HTML SSR renderer to handle async components better. Introduces a rendering lock mechanism to suspend sending the response to be able to handle response headers in async components until the lock is released.

Refactors HTTP response header handling to use Headers directly and introduces helper functions to set, append, delete, or clear response headers in the HTTP context.

Fixes an issue with accessing the Response sent to the client when using useResponse in an async React Server Component.

Adds test cases for above changes and updates the docs to include the new helpers and to give more details about how to handle response headers.

#100

@lazarv lazarv force-pushed the fix/set-http-headers branch from 05578a1 to 566b9c0 Compare December 23, 2024 11:51
@lazarv lazarv changed the title fix: set http headers using lowercase keys fix: handling http response headers Dec 23, 2024
Copy link

github-actions bot commented Dec 23, 2024

✅ Documentation preview deployed to: https://react-server-docs-mxyyw1ryq-lazarv-team.vercel.app

@lazarv lazarv merged commit 5e1cd79 into main Dec 23, 2024
8 checks passed
@lazarv lazarv deleted the fix/set-http-headers branch December 23, 2024 12:14
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