This project is archived and is in readonly mode.
Internet Explorer Accept header
Internet Explorer sends a rather retarded accept header, this causes Rails to respond with a whole slew of mime types before the sensible defaults: HTML and XML. For example:
repond_to do |format| format.html format.jpg do send_file @photo.public_path, :type => 'image/jpeg' end end
Will return the JPEG instead of the HTML version on a regular request.
Attached is a patch which prepends HTML and XML to ActionController::Request#accepts when the user agent suggests Internet Explorer.
Comments and changes to this ticket
- Assigned user set to Joshua Peek
Some examples of people running into this problem, primarily with serving XML feeds.
- State changed from new to open
- Milestone changed from 2.x to 2.3.6
- Assigned user changed from Joshua Peek to Yehuda Katz (wycats)
+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?
- State changed from open to committed
I tested applying this patch to rails 2.3.5 and this causes Internet Explorer to fail to respond to certain requests, for example:
@shouts = Shout.recent
respond_to do |format|
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 end
You 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 header
By this logic, a UA wanting to get a non-HTML response to an extensionless URI would have to either
- Supply a q
For 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
I have the same issue, but "IE Accept header related bugs" been fixed be remove this chunk of js code:
$('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.
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.
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>