Don't inject ANCM managed exception page into the static page (#10659)

This commit is contained in:
Justin Kotalik 2019-05-30 14:00:12 -07:00 committed by GitHub
parent 11061e412e
commit 98d02bb617
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 7 deletions

View File

@ -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

View File

@ -134,17 +134,21 @@ CreateApplication(
std::unique_ptr<InProcessOptions> 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<StartupExceptionApplication>(*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",
"<ul><li>The application failed to start</li><li>The application started but then stopped</li><li>The application started but threw an exception during startup</li></ul>",
g_errorPageContent),
"");
auto pErrorApplication = std::make_unique<StartupExceptionApplication>(*pServer,
*pHttpApplication,
options->QueryDisableStartUpErrorPage(),
hr,
content,
500i16,
30i16,
"Internal Server Error");

View File

@ -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();