Lighthouse has a new layout. Prefer the old one? Return to the old layout, and switch back any time from the link at the top of each page.

This project is archived and is in readonly mode.

Improved handling for MIME types

#1573

The first patch implements =~ in Mime::Type, to match the == implementation (for synonym handling).

The second uses Mime::JS in place of explicit references to text/javascript.

The third changes the default javascript MIME type to application/javascript, as text/javascript is obsolete per RFC 4329, section 7.

Reported by Seth Fitzsimmons · December 14th, 2008 @ 07:23 PM

State: stale
Milestone: 3.x
Assigned to: nobody
Importance: none

Activity

  1. Seth Fitzsimmons
  2. Seth Fitzsimmons
    Seth Fitzsimmons

    These patches are also in the javascript-mime-type branch of mojodna/rails

    December 14th, 2008 @ 07:25 PM

  3. josh
    josh
    • Assigned user set to josh
    • State changed from new to open

    0001 Looks good

    0002 In those cases Accept header cases, "#{Mime::JS}, text/html, application/xml, ", why not change the own thing to [Mime::JS, Mime::HTML, Mime::XML].join(", ")

    0003 I'm afraid make this change without some other support. I agree, we should do things according to the RFC, but I just want to make sure it won't have any other bad side effect.

    December 15th, 2008 @ 12:34 AM

  4. Seth Fitzsimmons
    Seth Fitzsimmons

    0002 - I was being lazy and limiting the scope of my changes to javascript-related stuff.

    0003 - I agree. This change is likely to affect lots of people that primarily use text/javascript (we identified this during a code review), so I expect lots of app tests to break (but to be easily fixed).

    I'm not sure how to go forward with it, but thought that it should at least be raised.

    December 15th, 2008 @ 12:57 AM

  5. Repository
    Repository
    • State changed from open to resolved

    (from [f36dafa492e3de66e624d81d6860f5f0536de6b0]) Implement Mime::Type.=~ to match all synonyms against arg [#1573 state:resolved] Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    December 15th, 2008 @ 06:24 PM

  6. Repository
    Repository

    (from [4966076d35d5d9510590d87d90dae8daf79b2069]) Use Mime::JS in place of explicit 'text/javascript' [#1573 state:resolved] Signed-off-by: Joshua Peek josh@joshpeek.com http://github.com/rails/rails/co...

    December 15th, 2008 @ 06:24 PM

  7. josh
    josh
    • State changed from resolved to open

    Did you intend to change "script type="text/javascript"" to "script type="application/javascript"" as well? Not sure I want to do that.

    December 15th, 2008 @ 06:26 PM

  8. Seth Fitzsimmons
    Seth Fitzsimmons

    That was intentional, but I agree, potentially dangerous.

    December 15th, 2008 @ 06:52 PM

  9. josh
    josh

    Could you please update 0003 to still change the default type, but fix the output from the javascript tag helper.

    Should be good to commit then.

    December 15th, 2008 @ 07:23 PM

  10. Seth Fitzsimmons
    Seth Fitzsimmons

    Will do, but I'm a bit busy, so it might be a week or so until I get to it.

    December 17th, 2008 @ 07:30 AM

  11. josh
    josh
    • State changed from open to incomplete

    December 28th, 2008 @ 08:55 PM

  12. josh
    josh
    • Assigned user cleared.

    August 19th, 2009 @ 03:44 PM

  13. Jeremy Kemper
    Jeremy Kemper
    • Milestone changed from 2.x to 3.x

    May 4th, 2010 @ 06:48 PM

  14. Rohit Arondekar
    Rohit Arondekar

    Any updates to this ticket?

    Seth, did you get around to editing the 3rd patch?

    June 17th, 2010 @ 07:10 AM

  15. Santiago Pastorino
    Santiago Pastorino
    • State changed from incomplete to open
    • Importance changed from to

    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.

    February 2nd, 2011 @ 04:37 PM

  16. Santiago Pastorino
    Santiago Pastorino
    • State changed from open to stale

    February 2nd, 2011 @ 04:37 PM