<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: IE6 Accept Header is Faulty and Makes format.any Suck</title>
	<atom:link href="http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/feed/" rel="self" type="application/rss+xml" />
	<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/</link>
	<description>Ruby on Rails Geek Blog</description>
	<lastBuildDate>Thu, 17 Dec 2009 18:16:08 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: jQuery, jRails and the Accept header - Moserei</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-148</link>
		<dc:creator>jQuery, jRails and the Accept header - Moserei</dc:creator>
		<pubDate>Thu, 18 Jun 2009 12:12:48 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-148</guid>
		<description>[...] browser compatibility I should favor the extension approach. And I&#8217;m not surprised it&#8217;s Microsoft&#8217;s [...]</description>
		<content:encoded><![CDATA[<p>[...] browser compatibility I should favor the extension approach. And I&#8217;m not surprised it&#8217;s Microsoft&#8217;s [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: dougmcinnes</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-124</link>
		<dc:creator>dougmcinnes</dc:creator>
		<pubDate>Thu, 02 Apr 2009 18:28:15 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-124</guid>
		<description>The problem still occurs in Rails 2.3.2

If you change &quot;ActionController::AbstractRequest&quot; to &quot;ActionController::Request&quot; in the fix you will be good to go.

Rails 2.3 swapped out CGI requests for Rack requests and removed the &quot;Abstract&quot; part of the class name.</description>
		<content:encoded><![CDATA[<p>The problem still occurs in Rails 2.3.2</p>
<p>If you change &#8220;ActionController::AbstractRequest&#8221; to &#8220;ActionController::Request&#8221; in the fix you will be good to go.</p>
<p>Rails 2.3 swapped out CGI requests for Rack requests and removed the &#8220;Abstract&#8221; part of the class name.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reidmix</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-82</link>
		<dc:creator>reidmix</dc:creator>
		<pubDate>Tue, 28 Oct 2008 22:19:58 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-82</guid>
		<description>Looks like they turned of the Accept header in Rails 2.2:

&lt;blockquote&gt;The HTTP Accept header is disabled by default now. You should prefer the use of formatted URLs (such as &lt;strong&gt;/customers/1.xml&lt;/strong&gt;) to indicate the format that you want. If you need the Accept headers, you can turn them back on with &lt;strong&gt;config.action_controller.user_accept_header = true.&lt;/strong&gt;&lt;/blockquote&gt;

http://guides.rubyonrails.org/2_2_release_notes.html section 6.3</description>
		<content:encoded><![CDATA[<p>Looks like they turned of the Accept header in Rails 2.2:</p>
<blockquote><p>The HTTP Accept header is disabled by default now. You should prefer the use of formatted URLs (such as <strong>/customers/1.xml</strong>) to indicate the format that you want. If you need the Accept headers, you can turn them back on with <strong>config.action_controller.user_accept_header = true.</strong></p></blockquote>
<p><a href="http://guides.rubyonrails.org/2_2_release_notes.html" rel="nofollow">http://guides.rubyonrails.org/2_2_release_notes.html</a> section 6.3</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Riopro Blog - &#187; Rails e um bug chamado IE6</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-76</link>
		<dc:creator>Riopro Blog - &#187; Rails e um bug chamado IE6</dc:creator>
		<pubDate>Mon, 29 Sep 2008 13:41:09 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-76</guid>
		<description>[...] solução para esse problema encontramos  nesse link que está em inglês. Com base nessa solução, fizemos (na verdade, o Rodrigo fez) um initializer [...]</description>
		<content:encoded><![CDATA[<p>[...] solução para esse problema encontramos  nesse link que está em inglês. Com base nessa solução, fizemos (na verdade, o Rodrigo fez) um initializer [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Recomand Mozilla Firefox &#124; Daniel Matasaru</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-58</link>
		<dc:creator>Recomand Mozilla Firefox &#124; Daniel Matasaru</dc:creator>
		<pubDate>Mon, 30 Jun 2008 05:11:36 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-58</guid>
		<description>[...] cu primul post. Nu sunteti primii, toata lumea a observat ca Microsoft are probleme&#8230; ( vezi aici [...]</description>
		<content:encoded><![CDATA[<p>[...] cu primul post. Nu sunteti primii, toata lumea a observat ca Microsoft are probleme&#8230; ( vezi aici [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: DrMark</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-57</link>
		<dc:creator>DrMark</dc:creator>
		<pubDate>Sat, 28 Jun 2008 02:45:50 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-57</guid>
		<description>When I tried this on edge rails it didn&#039;t fix the IE6 problem. I fixed it in the lib/authenticated_system.rb file. I did the following to fix it:

    def access_denied
+      request.format = :html if request.env[&#039;HTTP_USER_AGENT&#039;] =~ /msie/i &amp;&amp; (request.format.to_s =~ /(text&#124;html&#124;xml&#124;js&#124;\*)/).nil?
      respond_to do &#124;format&#124;
        format.html do
          store_location
          redirect_to new_sessions_path
        end
        # format.any doesn&#039;t work in rails version &lt; http://dev.rubyonrails.org/changeset/8987
        # you may want to change format.any to e.g. format.any(:js, :xml)
        format.any do
          request_http_basic_authentication &#039;Web Password&#039;
        end
      end
    end

My copy of IE6 was sending a type through. It was &quot;image/gif&quot; and for some reason the above code didn&#039;t fire and the http_auth dialog was displayed.

With my code, it works properly. What do you think?

Best of luck!</description>
		<content:encoded><![CDATA[<p>When I tried this on edge rails it didn&#8217;t fix the IE6 problem. I fixed it in the lib/authenticated_system.rb file. I did the following to fix it:</p>
<p>    def access_denied<br />
+      request.format = :html if request.env['HTTP_USER_AGENT'] =~ /msie/i &amp;&amp; (request.format.to_s =~ /(text|html|xml|js|\*)/).nil?<br />
      respond_to do |format|<br />
        format.html do<br />
          store_location<br />
          redirect_to new_sessions_path<br />
        end<br />
        # format.any doesn&#8217;t work in rails version &lt; <a href="http://dev.rubyonrails.org/changeset/8987" rel="nofollow">http://dev.rubyonrails.org/changeset/8987</a><br />
        # you may want to change format.any to e.g. format.any(:js, <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_mad.gif' alt=':x' class='wp-smiley' /> ml)<br />
        format.any do<br />
          request_http_basic_authentication &#8216;Web Password&#8217;<br />
        end<br />
      end<br />
    end</p>
<p>My copy of IE6 was sending a type through. It was &#8220;image/gif&#8221; and for some reason the above code didn&#8217;t fire and the http_auth dialog was displayed.</p>
<p>With my code, it works properly. What do you think?</p>
<p>Best of luck!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reidmix</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-47</link>
		<dc:creator>reidmix</dc:creator>
		<pubDate>Wed, 14 May 2008 20:33:16 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-47</guid>
		<description>AFAIK, rails will look at the Accept header and find the first match between the list and the types of files that can be delivered.  Lets say  there is an action that can respond (deliver) the follow formats:

&lt;pre class=&quot;brush: ruby;&quot;&gt;
def action
  respond_to do &#124;format&#124;
    format.html { # render html }
    format.xml  { # render xml }
    format.any  { # render json }
  end
end
&lt;/pre&gt;

If you have an Accept header that has text/html, application/xml, application/json, */*, the action will deliver html.

If you have an Accept header that has application/xml, text/html, application/json, */*, the action will deliver xml (first priority in the Accept list that matches).

If you have an Accept header that has text/plain, */* then the format.any will be selected and deliver json (impractical but good for my example).

And lastly if you just have */* as the Accept header, the action will deliver the first match in the action&#039;s respond_to, in this case, html.

Because, IE is not specifying html, xhtml in it&#039;s list but is specifying a bunch of other formats or just */*, then in the first case it will deliver text (format.any) and in the latter case it will deliver html (correctly). 

If I cannot rely on the Accept header and the header does not list html or xhtml, then I would say if I know the user agent is MSIE I should normalize it&#039;s Accept header to be the catch-all */* if it is not already.</description>
		<content:encoded><![CDATA[<p>AFAIK, rails will look at the Accept header and find the first match between the list and the types of files that can be delivered.  Lets say  there is an action that can respond (deliver) the follow formats:</p>
<pre class="brush: ruby;">
def action
  respond_to do |format|
    format.html { # render html }
    format.xml  { # render xml }
    format.any  { # render json }
  end
end
</pre>
<p>If you have an Accept header that has text/html, application/xml, application/json, */*, the action will deliver html.</p>
<p>If you have an Accept header that has application/xml, text/html, application/json, */*, the action will deliver xml (first priority in the Accept list that matches).</p>
<p>If you have an Accept header that has text/plain, */* then the format.any will be selected and deliver json (impractical but good for my example).</p>
<p>And lastly if you just have */* as the Accept header, the action will deliver the first match in the action&#8217;s respond_to, in this case, html.</p>
<p>Because, IE is not specifying html, xhtml in it&#8217;s list but is specifying a bunch of other formats or just */*, then in the first case it will deliver text (format.any) and in the latter case it will deliver html (correctly). </p>
<p>If I cannot rely on the Accept header and the header does not list html or xhtml, then I would say if I know the user agent is MSIE I should normalize it&#8217;s Accept header to be the catch-all */* if it is not already.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EricLaw [MSFT]</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-46</link>
		<dc:creator>EricLaw [MSFT]</dc:creator>
		<pubDate>Wed, 14 May 2008 18:37:49 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-46</guid>
		<description>I&#039;m not entirely sure I understand the scenario of what you&#039;re trying to do here (likely because I don&#039;t know anything about Rails).

The Accept header in IE is one of two values: */*, or a string made up from the values of the &quot;Accepted Documents&quot; key in the system registry.  That key is accessible to anything installed on the system, so some applications (e.g. Office) and add-ons (Flash/Silverlight, etc) shove their own values in there.</description>
		<content:encoded><![CDATA[<p>I&#8217;m not entirely sure I understand the scenario of what you&#8217;re trying to do here (likely because I don&#8217;t know anything about Rails).</p>
<p>The Accept header in IE is one of two values: */*, or a string made up from the values of the &#8220;Accepted Documents&#8221; key in the system registry.  That key is accessible to anything installed on the system, so some applications (e.g. Office) and add-ons (Flash/Silverlight, etc) shove their own values in there.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: reidmix</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-45</link>
		<dc:creator>reidmix</dc:creator>
		<pubDate>Wed, 14 May 2008 17:38:36 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-45</guid>
		<description>Good to know, I wondered if certain versions of IE6 only sent those headers specifically.  

So would you suggest I normalize all IE6 HTTP_ACCEPT headers to be the catch-all?  

I&#039;m still feeling unsure about normalizing the header to the catch-all rather than knowing what IE6&#039;s true capabilities are via the Accept header.</description>
		<content:encoded><![CDATA[<p>Good to know, I wondered if certain versions of IE6 only sent those headers specifically.  </p>
<p>So would you suggest I normalize all IE6 HTTP_ACCEPT headers to be the catch-all?  </p>
<p>I&#8217;m still feeling unsure about normalizing the header to the catch-all rather than knowing what IE6&#8217;s true capabilities are via the Accept header.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: EricLaw [MSFT]</title>
		<link>http://geminstallthat.wordpress.com/2008/05/14/ie6-accept-header-is-faulty/#comment-44</link>
		<dc:creator>EricLaw [MSFT]</dc:creator>
		<pubDate>Wed, 14 May 2008 17:27:23 +0000</pubDate>
		<guid isPermaLink="false">http://geminstallthat.wordpress.com/?p=33#comment-44</guid>
		<description>Checking for an exact string is prone to failure, as there&#039;s no guarantee that IE6 will send the Accept tokens in that order, and/or that all of these tokens will be present (e.g. the following application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword are only sent when those applications are installed).

You can not rely on the Accept header (in any version of IE) to determine whether or not the request represents a top-level navigation.</description>
		<content:encoded><![CDATA[<p>Checking for an exact string is prone to failure, as there&#8217;s no guarantee that IE6 will send the Accept tokens in that order, and/or that all of these tokens will be present (e.g. the following application/x-shockwave-flash, application/vnd.ms-excel, application/vnd.ms-powerpoint, application/msword are only sent when those applications are installed).</p>
<p>You can not rely on the Accept header (in any version of IE) to determine whether or not the request represents a top-level navigation.</p>
]]></content:encoded>
	</item>
</channel>
</rss>
