callum <[EMAIL PROTECTED]> wrote:
> I want to detect the content type of a URI and decide where to load
> the page or not based on what it is.

You are saying you want to get the type of content without actually 
seeing any bytes of the content? How do you expect this to work?

> I thought I might be able to to it in
> nsIWebProgressListener::OnStateChange(..) when I get a STATE_START bit
> by asking nsIHttpChannel::GetRequestHeader() for the "Content-Type"
> header but this fails.

Because at this point not a single byte has been received from the 
server yet - not even Content-Type header. You need to wait for 
STATE_TRANSFERRING, I believe, and hope that the server actually sends 
Content-Type.

Igor Tandetnik 


_______________________________________________
dev-embedding mailing list
[email protected]
https://lists.mozilla.org/listinfo/dev-embedding

Reply via email to