Serve 503 if server process is shutting down (#1293)

This commit is contained in:
Pavel Krymets 2018-08-22 09:53:25 -07:00 committed by GitHub
parent e26231b613
commit 36e5aceb3c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -344,6 +344,10 @@ Failure:
{
pResponse->SetStatus(400, "Bad Request", 0, hr);
}
else if (hr == E_APPLICATION_EXITING)
{
pResponse->SetStatus(503, "Service Unavailable", 0, S_OK, nullptr, TRUE);
}
else if (fFailedToStartKestrel && !m_pApplication->QueryConfig()->QueryDisableStartUpErrorPage())
{
HTTP_DATA_CHUNK DataChunk;