So I've tried to use PassthruAPP. I've put mime type check into
CTestSink::OnResponse() like this:
....
CComPtr<IHttpNegotiate> spHttpNegotiate;
QueryServiceFromClient(&spHttpNegotiate);
if (dwResponseCode == 200 && szResponseHeaders &&
wcsstr(szResponseHeaders,L"\r\nContent-Type: application/x-csv\r\n"))
{
CStringW hdr = szResponseHeaders;
hdr.Replace(L"\r\nContent-Type: application/x-csv\r\n",L"\r\nContent-
Type: text/html\r\n");
HRESULT hr = spHttpNegotiate ?
spHttpNegotiate->OnResponse(dwResponseCode, hdr,
szRequestHeaders, pszAdditionalRequestHeaders) :
S_OK;
return hr;
}
....
It is called, but it does not help. ReportProgress() is still called
with BINDSTATUS_MIMETYPEAVAILABLE set to original mime type. So I've
tried also to handle ReportProgress():
if (ulStatusCode == BINDSTATUS_MIMETYPEAVAILABLE
{
if (szStatusText && !_wcsicmp(szStatusText,L"application/x-csv"))
{
HRESULT hr = m_spInternetProtocolSink ?
m_spInternetProtocolSink->ReportProgress(ulStatusCode, L"text/
html") :
S_OK;
return hr;
}
}
but it still does not help. Do you have idea how IE knows the original
mime type and why this does not work? How can I solve this?
Thank you.