-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
Pillar: Complete Blazor Webarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one
Milestone
Description
If you try to use Blazor pages with the status code pages middleware you get unexpected behavior.
Repro steps:
- Create a Blazor Web App with global interactive server rendering
- Add the status code pages middleware to Program.cs:
app.UseStatusCodePagesWithReExecute("/StatusCode/{0}"); - Add Components/Pages/StatusCode.razor:
@page "/StatusCode/{status:int}"
<PageTitle>@Status</PageTitle>
<h1>@Status</h1>
@code {
[Parameter]
public int Status { get; set; }
}- Run the app and browser to a non-existent page, like /test
Expected result: Blazor status page renders for the 404 response.
Actual result: Blazor status page shows up briefly and then is replaced with a plain text "Not found" page.
We special case re-executed requests from the error handling middleware. We might need to do this for the status code page middleware as well.
Related issue for handling not found requests: #45654
luis-fss, KirillReutImpet, Eivinddh, kjkrum, timv-tm and 3 more
Metadata
Metadata
Assignees
Labels
Pillar: Complete Blazor Webarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor ComponentsenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing one