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

[release/9.0-rc2] [Blazor] Update WebAssembly.DevServer to serve the Blazor-Environment header #57974

Merged
merged 3 commits into from
Sep 20, 2024

Conversation

github-actions[bot]
Copy link
Contributor

@github-actions github-actions bot commented Sep 19, 2024

Backport of #57971 to release/9.0-rc2

/cc @MackinnonBuck

[Blazor] Update WebAssembly.DevServer to serve the Blazor-Environment header

Fixes a recent regression that caused Blazor WebAssembly Standalone apps to always interpret the ASP.NET Core environment as "Production" during development.

Description

Blazor WebAssembly apps determine the ASP.NET Core environment by reading the Blazor-Environment header in the response for the boot manifest (blazor.boot.json). A recent change caused the WebAssembly development server to stop serving this header, which resulted in IWebAssemblyHostEnvironment.Environment always returning "Production". This PR fixes the issue by updating the development server to correctly serve the header.

Fixes #57941

Customer Impact

Without this fix, customers relying on IWebAssemblyHostEnvironment to selectively enable features based on the environment will experience problems during development. They will need to find another solution to determine whether the app is running in a development environment.

Regression?

  • Yes
  • No

Regressed in .NET 9 Preview 6

Risk

  • High
  • Medium
  • Low

The fix is straightforward, and automated tests now validate the expected behavior.

Verification

  • Manual (required)
  • Automated

Packaging changes reviewed?

  • Yes
  • No
  • N/A

@github-actions github-actions bot requested a review from a team as a code owner September 19, 2024 22:08
@dotnet-issue-labeler dotnet-issue-labeler bot added the area-blazor Includes: Blazor, Razor Components label Sep 19, 2024
@MackinnonBuck MackinnonBuck added the ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. label Sep 19, 2024
Copy link
Member

@mkArtakMSFT mkArtakMSFT left a comment

Choose a reason for hiding this comment

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

Thanks @MackinnonBuck !

@mkArtakMSFT mkArtakMSFT added Servicing-consider Shiproom approval is required for the issue and removed ask-mode This issue / PR is a patch candidate which we will bar-check internally before patching it. labels Sep 19, 2024
@mkArtakMSFT mkArtakMSFT added Servicing-approved Shiproom has approved the issue and removed Servicing-consider Shiproom approval is required for the issue labels Sep 20, 2024
@wtgodbe
Copy link
Member

wtgodbe commented Sep 20, 2024

Test failure unrelated

@wtgodbe wtgodbe merged commit 8371724 into release/9.0-rc2 Sep 20, 2024
23 of 25 checks passed
@wtgodbe wtgodbe deleted the backport/pr-57971-to-release/9.0-rc2 branch September 20, 2024 19:14
@dotnet-policy-service dotnet-policy-service bot added this to the 9.0-rc2 milestone Sep 20, 2024
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 Servicing-approved Shiproom has approved the issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants