contype UserAgent requests in Internet Explorer

Requests made by Internet Explorer that set the UserAgent header to "contype" is IE's attempt to figure out the content type of a file that needs to be retrieved.

This usually happens when you embed some type of object into a page, for example a swf or a pdf viewer.

This can be problematic when you deliver the the file through your own dynamic script because it is not very well known how this request needs to be handled. When such a request is received, the only reply that needs to be sent back is a header that specifies the content-type on the file. An example in php for a swf request:

if($_SERVER['HTTP_USER_AGENT']=='contype')
{
header('Content-Type: application/x-shockwave-flash');
die();
}

In latest IE browsers you can avoid this extra request by specifying the correct clsid for the embed type in the object tag. In this way you tell IE what content-type follows and it won't make the contype request anymore. ex for a swf embedded file:

Technology: 

Comments

If IE really does that, this

If IE really does that, this is yet another reason to not use it. This is just crappy. HTTP has the HEAD method for that, so it can instruct the webserver/script to only return the HTTP headers, without the need to rely on some weird User-Agent string.

Pages

Add new comment