revert the preserve host header change as it failed on Antares (#114)
This commit is contained in:
parent
cee4cf7544
commit
6b411adbd0
|
|
@ -33,6 +33,12 @@ class PROTOCOL_CONFIG
|
||||||
return m_msTimeout;
|
return m_msTimeout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
BOOL
|
||||||
|
QueryPreserveHostHeader() const
|
||||||
|
{
|
||||||
|
return m_fPreserveHostHeader;
|
||||||
|
}
|
||||||
|
|
||||||
BOOL
|
BOOL
|
||||||
QueryReverseRewriteHeaders() const
|
QueryReverseRewriteHeaders() const
|
||||||
{
|
{
|
||||||
|
|
@ -84,6 +90,7 @@ class PROTOCOL_CONFIG
|
||||||
private:
|
private:
|
||||||
|
|
||||||
BOOL m_fKeepAlive;
|
BOOL m_fKeepAlive;
|
||||||
|
BOOL m_fPreserveHostHeader;
|
||||||
BOOL m_fReverseRewriteHeaders;
|
BOOL m_fReverseRewriteHeaders;
|
||||||
BOOL m_fIncludePortInXForwardedFor;
|
BOOL m_fIncludePortInXForwardedFor;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -635,19 +635,21 @@ FORWARDING_HANDLER::GetHeaders(
|
||||||
// this is wrong but Kestrel has dependency on it.
|
// this is wrong but Kestrel has dependency on it.
|
||||||
// should change it in the future
|
// should change it in the future
|
||||||
//
|
//
|
||||||
if (FAILED(hr = PATH::SplitUrl(pRequest->GetRawHttpRequest()->CookedUrl.pFullUrl,
|
if (!pProtocol->QueryPreserveHostHeader())
|
||||||
&fSecure,
|
|
||||||
&struDestination,
|
|
||||||
&struUrl)) ||
|
|
||||||
FAILED(hr = strTemp.CopyW(struDestination.QueryStr())) ||
|
|
||||||
FAILED(hr = pRequest->SetHeader(HttpHeaderHost,
|
|
||||||
strTemp.QueryStr(),
|
|
||||||
static_cast<USHORT>(strTemp.QueryCCH()),
|
|
||||||
TRUE))) // fReplace
|
|
||||||
{
|
{
|
||||||
return hr;
|
if (FAILED(hr = PATH::SplitUrl(pRequest->GetRawHttpRequest()->CookedUrl.pFullUrl,
|
||||||
|
&fSecure,
|
||||||
|
&struDestination,
|
||||||
|
&struUrl)) ||
|
||||||
|
FAILED(hr = strTemp.CopyW(struDestination.QueryStr())) ||
|
||||||
|
FAILED(hr = pRequest->SetHeader(HttpHeaderHost,
|
||||||
|
strTemp.QueryStr(),
|
||||||
|
static_cast<USHORT>(strTemp.QueryCCH()),
|
||||||
|
TRUE))) // fReplace
|
||||||
|
{
|
||||||
|
return hr;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
// Strip all headers starting with MS-ASPNETCORE.
|
// Strip all headers starting with MS-ASPNETCORE.
|
||||||
// These headers are generated by the asp.net core module and
|
// These headers are generated by the asp.net core module and
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@ PROTOCOL_CONFIG::Initialize()
|
||||||
|
|
||||||
m_fKeepAlive = TRUE;
|
m_fKeepAlive = TRUE;
|
||||||
m_msTimeout = 120000;
|
m_msTimeout = 120000;
|
||||||
|
m_fPreserveHostHeader = TRUE;
|
||||||
m_fReverseRewriteHeaders = FALSE;
|
m_fReverseRewriteHeaders = FALSE;
|
||||||
|
|
||||||
if (FAILED(hr = m_strXForwardedForName.CopyW(L"X-Forwarded-For")))
|
if (FAILED(hr = m_strXForwardedForName.CopyW(L"X-Forwarded-For")))
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue