From 1f6e2c8029a37042e995d850cfd4856249d4e401 Mon Sep 17 00:00:00 2001 From: pan-wang Date: Wed, 21 Feb 2018 11:27:48 -0800 Subject: [PATCH] grant the config setting on 502.5 page setting (#600) grant the config setting on 502.5 page setting --- src/RequestHandler/outofprocess/forwardinghandler.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/RequestHandler/outofprocess/forwardinghandler.cpp b/src/RequestHandler/outofprocess/forwardinghandler.cpp index 293c56bfd5..759a1bb0f8 100644 --- a/src/RequestHandler/outofprocess/forwardinghandler.cpp +++ b/src/RequestHandler/outofprocess/forwardinghandler.cpp @@ -116,7 +116,7 @@ FORWARDING_HANDLER::OnExecuteRequestHandler() if (pApplication == NULL) { hr = E_INVALIDARG; - goto Finished; + goto Failure; } hr = pApplication->GetProcess(&pServerProcess); @@ -330,7 +330,7 @@ Failure: { pResponse->SetStatus(400, "Bad Request", 0, hr); } - else + else if (fFailedToStartKestrel && !m_pApplication->QueryConfig()->QueryDisableStartUpErrorPage()) { HTTP_DATA_CHUNK DataChunk; pResponse->SetStatus(502, "Bad Gateway", 5, hr, NULL, TRUE); @@ -345,6 +345,13 @@ Failure: DataChunk.FromMemory.BufferLength = sm_pStra502ErrorMsg.QueryCB(); pResponse->WriteEntityChunkByReference(&DataChunk); } + else + { + // + // default error behavior + // + pResponse->SetStatus(502, "Bad Gateway", 3, hr); + } // // Finish the request on failure. //