diff --git a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/file_utility.cpp b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/file_utility.cpp index fb10427e3f..b2c7adce61 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/file_utility.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/CommonLib/file_utility.cpp @@ -168,9 +168,9 @@ Finished: return hr; } -std::string FILE_UTILITY::GetHtml(HMODULE module, int page, USHORT statusCode, USHORT subStatusCode, const std::string& speicificReasonPhrase, const std::string& solution) +std::string FILE_UTILITY::GetHtml(HMODULE module, int page, USHORT statusCode, USHORT subStatusCode, const std::string& specificReasonPhrase, const std::string& solution) { - return GetHtml(module, page, statusCode, subStatusCode, speicificReasonPhrase, solution, std::string()); + return GetHtml(module, page, statusCode, subStatusCode, specificReasonPhrase, solution, std::string()); } std::string diff --git a/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp b/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp index cd9261a56c..664d8130d2 100644 --- a/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp +++ b/src/Servers/IIS/AspNetCoreModuleV2/InProcessRequestHandler/dllmain.cpp @@ -134,17 +134,21 @@ CreateApplication( std::unique_ptr options; THROW_IF_FAILED(InProcessOptions::Create(*pServer, pSite, *pHttpApplication, options)); // Set the currently running application to a fake application that returns startup exceptions. - auto pErrorApplication = std::make_unique(*pServer, - *pHttpApplication, - options->QueryDisableStartUpErrorPage(), - hr, + auto content = !g_errorPageContent.empty() ? + g_errorPageContent : FILE_UTILITY::GetHtml(g_hServerModule, IN_PROCESS_RH_STATIC_HTML, 500i16, 30i16, "ANCM In-Process Start Failure", "", - g_errorPageContent), + ""); + + auto pErrorApplication = std::make_unique(*pServer, + *pHttpApplication, + options->QueryDisableStartUpErrorPage(), + hr, + content, 500i16, 30i16, "Internal Server Error"); diff --git a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs index 686164f3cf..572b85d823 100644 --- a/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs +++ b/src/Servers/IIS/IIS/test/Common.FunctionalTests/Inprocess/StartupTests.cs @@ -740,6 +740,7 @@ namespace Microsoft.AspNetCore.Server.IIS.FunctionalTests.InProcess Assert.Contains("InvalidOperationException", content); Assert.Contains("TestSite.Program.Main", content); Assert.Contains("From Configure", content); + Assert.DoesNotContain("ANCM In-Process Start Failure", content); StopServer();