\
-
HTTP Error 502.5 - Process Failure
\
-
\
-
\
-
\
-
\
-
\
-
\
-
\
-
");
-
-Finished:
- if (FAILED(hr))
- {
- StaticTerminate();
- }
- return hr;
-}
-
-//static
-VOID
-FORWARDING_HANDLER::StaticTerminate()
-{
- sm_pStra502ErrorMsg.Reset();
-
- if (sm_pResponseHeaderHash != NULL)
- {
- sm_pResponseHeaderHash->Clear();
- delete sm_pResponseHeaderHash;
- sm_pResponseHeaderHash = NULL;
- }
-
- if (sm_pTraceLog != NULL)
- {
- DestroyRefTraceLog(sm_pTraceLog);
- sm_pTraceLog = NULL;
- }
-
- if (sm_pAlloc != NULL)
- {
- delete sm_pAlloc;
- sm_pAlloc = NULL;
- }
-}
-
-HRESULT
-FORWARDING_HANDLER::GetHeaders(
- _In_ const PROTOCOL_CONFIG * pProtocol,
- _In_ BOOL fForwardWindowsAuthToken,
- _In_ SERVER_PROCESS* pServerProcess,
- _Out_ PCWSTR * ppszHeaders,
- _Inout_ DWORD * pcchHeaders
-)
-{
- HRESULT hr = S_OK;
- PCSTR pszCurrentHeader;
- PCSTR ppHeadersToBeRemoved;
- PCSTR pszFinalHeader;
- USHORT cchCurrentHeader;
- DWORD cchFinalHeader;
- BOOL fSecure = FALSE; // dummy. Used in SplitUrl. Value will not be used
- // as ANCM always use http protocol to communicate with backend
- STRU struDestination;
- STRU struUrl;
- STACK_STRA(strTemp, 64);
- HTTP_REQUEST_HEADERS *pHeaders;
- IHttpRequest *pRequest = m_pW3Context->GetRequest();
- MULTISZA mszMsAspNetCoreHeaders;
-
- //
- // We historically set the host section in request url to the new host header
- // this is wrong but Kestrel has dependency on it.
- // should change it in the future
- //
- if (!pProtocol->QueryPreserveHostHeader())
- {
- if (FAILED(hr = UTILITY::SplitUrl(pRequest->GetRawHttpRequest()->CookedUrl.pFullUrl,
- &fSecure,
- &struDestination,
- &struUrl)) ||
- FAILED(hr = strTemp.CopyW(struDestination.QueryStr())) ||
- FAILED(hr = pRequest->SetHeader(HttpHeaderHost,
- strTemp.QueryStr(),
- static_cast