Skip to content

Commit 74b7cc8

Browse files
committed
Updated Host sites to disable includeStaticFiles
By passing the `includeStaticFiles` argument in `MapTopicErrors()` (b591bd7), we are effectively disabling `includeStaticFiles` in the corresponding `ErrorController.Http()` action (83f4691). While `includeStaticFiles` defaults to true, since it's the intuitive baseline, we expect most implementers will want to disable it, and thus have made it the standard in the boilerplate `Host` file. Adding it to the integration tests' `Host` will allow us to follow-up with an integration test of the Feature #101 functionality; see next commit.
1 parent 240d47f commit 74b7cc8

2 files changed

Lines changed: 3 additions & 3 deletions

File tree

OnTopic.AspNetCore.Mvc.Host/Program.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@
5353
/*------------------------------------------------------------------------------------------------------------------------------
5454
| Configure: Error Pages
5555
\-----------------------------------------------------------------------------------------------------------------------------*/
56-
if (!app.Environment.IsDevelopment()) {
5756
app.UseStatusCodePagesWithReExecute("/Error/{0}/");
57+
if (!app.Environment.IsDevelopment()) {
5858
app.UseExceptionHandler("/Error/500/");
5959
// The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts.
6060
app.UseHsts();
@@ -77,7 +77,7 @@
7777
app.MapDefaultAreaControllerRoute(); // {area:exists}/{controller}/{action=Index}/{id?}
7878
app.MapTopicAreaRoute(); // {area:exists}/{**path}
7979

80-
app.MapTopicErrors(rootTopic: "Error"); // Error/{statusCode}
80+
app.MapTopicErrors(includeStaticFiles: false); // Error/{statusCode}
8181
app.MapDefaultControllerRoute(); // {controller=Home}/{action=Index}/{id?}
8282
app.MapTopicRoute(rootTopic: "Web"); // Web/{**path}
8383
app.MapTopicRoute(rootTopic: "Error"); // Error/{**path}

OnTopic.AspNetCore.Mvc.IntegrationTests.Host/Startup.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ public static void Configure(IApplicationBuilder app) {
9595
| Configure: MVC
9696
\-----------------------------------------------------------------------------------------------------------------------*/
9797
app.UseEndpoints(endpoints => {
98-
endpoints.MapTopicErrors();
98+
endpoints.MapTopicErrors(includeStaticFiles: false);
9999
endpoints.MapDefaultAreaControllerRoute();
100100
endpoints.MapDefaultControllerRoute();
101101
endpoints.MapImplicitAreaControllerRoute();

0 commit comments

Comments
 (0)