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

Make EndpointHtmlRenderer track the HttpContext #48088

Merged

Conversation

SteveSandersonMS
Copy link
Member

This is a really minor detail but I'm splitting it out from my larger PR about render modes just to try to keep the bigger one more practical to review clearly.

EndpointHtmlRenderer will need access to the HttpContext when writing out the HTML content to the response writer because this is used as part of generating the Server/WebAssembly markers for interactive components (e.g., to track per-response marker sequence numbers and to use DataProtection for formatting the server component markers).

Currently, it doesn't have access to the HttpContext at the right time, so this PR makes it treat HttpContext as an instance field, rather than something that just lives transiently in the call stack. This is perfectly fine to do because EndpointHtmlRender is scoped to the request anyway.

@SteveSandersonMS SteveSandersonMS requested a review from a team as a code owner May 5, 2023 15:36
@ghost ghost added the area-blazor Includes: Blazor, Razor Components label May 5, 2023
Copy link
Member

@surayya-MS surayya-MS left a comment

Choose a reason for hiding this comment

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

Looks good to me

@SteveSandersonMS SteveSandersonMS enabled auto-merge (squash) May 5, 2023 16:05
@SteveSandersonMS SteveSandersonMS merged commit acbcf16 into main May 5, 2023
@SteveSandersonMS SteveSandersonMS deleted the stevesa/endpointhtmlrenderer-hold-httpcontext branch May 5, 2023 17:04
@ghost ghost added this to the 8.0-preview5 milestone May 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-blazor Includes: Blazor, Razor Components
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants