This project is archived and is in readonly mode.
Internet Explorer Accept header
-
Manfred Stienstra
- Assigned user set to josh
Some examples of people running into this problem, primarily with serving XML feeds.
http://log.maniacalrage.net/post/56019689/tip-avoid-ie-issues-with-...
http://ianma.wordpress.com/2009/05/06/ruby-on-rails-respond_to-bug-...
http://garrickvanburen.com/archive/workaround-for-ie-overly-accepti...
http://info.michael-simons.eu/2007/08/06/rails-respond_to-method/ -
josh
- State changed from new to open
- Milestone changed from 2.x to 2.3.6
- Assigned user changed from josh to Yehuda Katz (wycats)
Ouch!
+1 to apply.
I known Yehuda made some changes to Accepts in 3.x so I'm not sure if its affected as well.
Do you think something similar should be applied to Rack core?
-
Manfred Stienstra
There is nothing in Rails 3 addressing this issue as far as I can see. I don't think this belongs in Rack, it's coupled with the way Rails does content negotiation.
-
Yehuda Katz (wycats)
The fix in 3.0 is to reject Accept header usage if more than one MIME is specified.
This means that:
Accept: text/htmlwill work, but:
Accept: rather/retarded, ie/headerwill fall back to text/html.
-
josh
- Assigned user changed from Yehuda Katz (wycats) to josh
-
josh
- Assigned user changed from josh to Michael Koziarski
Koz, can you weigh in.
(Sorry for all the handoffs)
-
Manfred Stienstra
- State changed from open to committed
-
Michael Koziarski
fwiw, this is why I added use_accept_header = false. It's a nice science experiment, but the header's basically junk in the wild.
-
Nazgum
I tested applying this patch to rails 2.3.5 and this causes Internet Explorer to fail to respond to certain requests, for example:
def update_chat
@shouts = Shout.recentrespond_to do |format|
format.jsend end
This method, which only responds to javascript, fails with Internet Explorer once this patch is applied, as Internet Explorer responds to the first mime type, which is text/html with this patch, which does not exist in this method..
-
Manfred Stienstra
- State changed from committed to open
The patch was applied and reverted for specifically that reason. I guess we should reopen it and take another look.
-
Gareth Adams
Could this be improved by adopting some kind of qs (quality of source) parameter to the format.* call, in the same way as Apache's content negotiation works?
repond_to do |format| format.html format.jpg :qs => 0.8 do send_file @photo.public_path, :type => 'image/jpeg' end endYou would have to ensure that
- A MIME type match by extension would automatically match its exact format block - A request without an extension would be matched by a q/qs algorithm like that in Apache's content negotiation - Suitable default qs values were set for different MIME types to reflect that a) Rails prefers serving HTML documents b) Some browsers aren't very good at specifying their Accept headerBy this logic, a UA wanting to get a non-HTML response to an extensionless URI would have to either
- Supply a qFor example, Firefox supplies a different Accepts header for resources loaded through an
tag
Is this heading in the wrong direction? It seems to me that the Accept header is at most a guideline, so there shouldn't be any problem with using our own values to fudge the browser's requested quality values. The only problem would be doing the maths to work out the best possible 'fudge' values
-
Rohit Arondekar
Any updates to this ticket? Is somebody working on a new patch?
-
mikhailov
I have the same issue, but "IE Accept header related bugs" been fixed be remove this chunk of js code:
$("form").submit(function(){$('input[type=submit]').attr('disabled', 'disabled'); return true;});
It's weird for me, because I was looking for an issue in server-side code.
please be ensure that all is ok with your client-side scripts. -
sunkencity
Same problem in rails 3 with IE if having an action that can return the data in .xls format.
-
Santiago Pastorino
This issue has been automatically marked as stale because it has not been commented on for at least three months.
The resources of the Rails core team are limited, and so we are asking for your help. If you can still reproduce this error on the 3-0-stable branch or on master, please reply with all of the information you have about it and add "[state:open]" to your comment. This will reopen the ticket for review. Likewise, if you feel that this is a very important feature for Rails to include, please reply with your explanation so we can consider it.
Thank you for all your contributions, and we hope you will understand this step to focus our efforts where they are most helpful.
-
Santiago Pastorino
- State changed from open to stale
