-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lookups for csv return text/comma-separated-values over text/csv #3
Comments
I think we should probably fix this, upstream cause
The types type_for returns are sorted per: perhaps raise this on https://github.com/mime-types/ruby-mime-types cc @halostatue |
@SamSaffron However, they also have an obsolete and registered attribute, where text/comma-separated-values is both obsolete:true and registered:false MIME::Types.type_for("x.csv").map(&:to_h)
=> [
{"content-type"=>"text/comma-separated-values",
"encoding"=>"8bit",
"extensions"=>["csv"],
"obsolete"=>true,
"use-instead"=>"text/csv",
"registered"=>false},
{"content-type"=>"text/csv",
"friendly"=>{"en"=>"Comma-Separated Values"},
"encoding"=>"8bit",
"extensions"=>["csv"],
"xrefs"=>{"rfc"=>["rfc4180"], "template"=>["text/csv"]},
"registered"=>true}
] |
Looks like a super easy fix then, mind doing a PR to fix the rake task and
tests?
…On Mon, 27 Mar 2017 at 4:45 pm, Jason Frey ***@***.***> wrote:
@SamSaffron <https://github.com/SamSaffron> However, they also have an
obsolete and registered attribute, where text/comma-separated-values is
both obsolete:true and registered:false
MIME::Types.type_for("x.csv").map(&:to_h)
=> [
{"content-type"=>"text/comma-separated-values",
"encoding"=>"8bit",
"extensions"=>["csv"],
"obsolete"=>true,
"use-instead"=>"text/csv",
"registered"=>false},
{"content-type"=>"text/csv",
"friendly"=>{"en"=>"Comma-Separated Values"},
"encoding"=>"8bit",
"extensions"=>["csv"],
"xrefs"=>{"rfc"=>["rfc4180"], "template"=>["text/csv"]},
"registered"=>true}
]
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#3 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAAUXccr6pHY8Vv8KOp7VxSCmtmIXyhXks5rqBdWgaJpZM4MqkfO>
.
|
what I am having trouble understanding here is why there is both a "obsolete" and "registered" flag... what does it mean to have a mime type that is not registered and not obsolete? |
I guess I will just reply here :) access is weird mda has no registered mime types, but has a non obsolete mime type, so we should prefer "application/x-msaccess" to "application/access" which is obsolete but higher priority |
@SamSaffron I started to do this last night, but realized that A LOT of changes were going to be needed to the dbs, as there are a bunch of obsoleted values in there. I wrote a script that can regenerate the .dbs, and I should have that pushed up a little later if you want to review it (busy with day job at the moment). |
interesting...So we should prefer the obsolete one over the non-obsolete one? |
I just committed a fix Can you review it? 3cd66be |
Looks good...made a comment on how the Ruby can be cleaned up, but overall it's great. Thanks for fixing this! |
Closed in 3cd66be |
I see it in the db, so it's working correctly, but I'm curious why
text/comma-separated-values
was chosen overtext/csv
. I'm trying to see if I can get capybara updated to use mini_mime but they have a test that's failing and expecting"Content-type: text/csv"
. I'm not sure it matters, and I can easily change the test on the Capybara side, but I dug in a little further and found a StackOverflow article stating that the RFC suggests to use text/csv: http://stackoverflow.com/questions/7076042/what-mime-type-should-i-use-for-csv . So, what's the "right" mime type, and if we need to change it, how does that affect users of the gem?The text was updated successfully, but these errors were encountered: