Skip to content

Commit 1e207c2

Browse files
committed
Add error pages middlewarefor reexecution + use status code pages on static files as well.
1 parent 05169c9 commit 1e207c2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/Components/test/testassets/Components.TestServer/RazorComponentEndpointsNoInteractivityStartup.cs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,8 +50,13 @@ public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
5050
{
5151
app.Map("/reexecution", reexecutionApp =>
5252
{
53-
reexecutionApp.UseStaticFiles();
53+
if (!env.IsDevelopment())
54+
{
55+
app.UseExceptionHandler("/Error", createScopeForErrors: true);
56+
}
57+
5458
reexecutionApp.UseStatusCodePagesWithReExecute("/not-found-reexecute", createScopeForErrors: true);
59+
reexecutionApp.UseStaticFiles();
5560
reexecutionApp.UseRouting();
5661
RazorComponentEndpointsStartup<TRootComponent>.UseFakeAuthState(reexecutionApp);
5762
reexecutionApp.UseAntiforgery();

0 commit comments

Comments
 (0)