views:

21

answers:

0

Hi.

First, sorry for my english, i'm not a native.

I got a Asynchronous Pluggable Protocol for IE, the target of this plugin is monitoring responses of the server when IE requests a web page.

Basically, plugin is a activeX what implements next interfaces:

class InternetProtocolHook : public CComObjectRootEx, public IInternetProtocol, public IInternetProtocolSink, public IServiceProvider, public IHttpNegotiate

and it is registered like this:

m_pHTTPHookFactory=new CComObject<InternetProtocolHookFactory>();
CHECKHR(pSession->RegisterNameSpace(m_hookFactory, CLSID_NULL, L"http", 0, 0, 0));

it works fine and plugin hooks events like Read, Continue, beginningTransaction, etc.

Problem occurs when this event is called:

STDMETHODIMP InternetProtocolHook::OnResponse(DWORD dwResponseCode, LPCWSTR szResponseHeaders, LPCWSTR szRequestHeaders, LPWSTR* pszAdditionalRequestHeaders)

In szResponseheaders param, header Content-Length is removed when server sends content compressed (gzip) and i don't understand why.

I Have search thounsand ways for get this header. How can it get this header? it's possible?

I tried get size using ReportData method, but size always is uncompressed.

Thanks.