{"id":279,"date":"2008-08-19T19:59:56","date_gmt":"2008-08-19T19:59:56","guid":{"rendered":"http:\/\/kera.name\/articles\/?p=279"},"modified":"2008-08-19T19:59:56","modified_gmt":"2008-08-19T19:59:56","slug":"just-what-doesnt-ie6-content-accept","status":"publish","type":"post","link":"https:\/\/kera.name\/articles\/2008\/08\/just-what-doesnt-ie6-content-accept\/","title":{"rendered":"Just What Doesn&#039;t IE6 Content-Accept?"},"content":{"rendered":"<p>Today at work I discovered a flaw in our framework that was really pretty obvious from IE6, but hadn&#039;t been noticed at all pre-testing because nobody expected it.<\/p>\n<p>Our MVC architecture (Model, View, Controller) is capable of responding to HTTP requests with Smarty-generated template output, plain text, or image data. Plain text is used only for debugging and the template output is basic HTML. Both of those are fine.<\/p>\n<p>When we came to implementing database image retrieval, however, we relied on the notion that browsers send a <code>Content-Accept<\/code> header of &#034;<code>image\/*<\/code>&#034; when bringing data into an <code>&amp;lt;img&amp;gt;<\/code> tag. We used this supposed fact to automatically serve the image data with an appropriate MIME type, and without attempting to pull an HTML template through.<\/p>\n<p>Now, it would make a lot more sense for content to be served according to the controller that produced it, rather than by what the remote client says it ought to be. What can I say except &#034;management&#034;? The upshot is that the <code>Content-Accept<\/code> request header defines what type of response is sent back.<\/p>\n<p>Alas IE6 fails when someone submits an HTML form, at which point it seems to noisily accept pretty much anything. The exact <code>Content-Accept<\/code> header received by the webserver after I submitted our application&#039;s login form from my copy of IE6 is as follows:<\/p>\n<blockquote><p>\nimage\/gif, image\/x-xbitmap, image\/jpeg, image\/pjpeg, application\/x-shockwave-flash, application\/vnd.ms-excel, application\/vnd.ms-powerpoint, application\/msword, application\/xaml+xml, application\/vnd.ms-xpsdocument, application\/x-ms-xbap, application\/x-ms-application *\/*<\/p><\/blockquote>\n<p>Overkill? I think so, since I can&#039;t think of any reason to specify all of these possibilities <em>and<\/em> a catch-all; meanwhile, we can no longer rely on the presence of an <code>image\/*<\/code> type in a request&#039;s Content-Accept string to determine what view type is appropriate. After all, it&#039;s no use our application trying to compile valid image data from a &#034;login successful&#034; HTML page.<\/p>\n<p><strong>Bootnote<\/strong><\/p>\n<p>It would be better if IE6 just sent a <em>\/<\/em> Content-Accept string if it really wants to. I don&#039;t know if IE7 does or not.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Today at work I discovered a flaw in our framework that was really pretty obvious from IE6, but hadn&#039;t been noticed at all pre-testing because nobody expected it.<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[9],"_links":{"self":[{"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/posts\/279"}],"collection":[{"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/comments?post=279"}],"version-history":[{"count":1,"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/posts\/279\/revisions"}],"predecessor-version":[{"id":280,"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/posts\/279\/revisions\/280"}],"wp:attachment":[{"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/media?parent=279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/categories?post=279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/kera.name\/articles\/wp-json\/wp\/v2\/tags?post=279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}