Closed gmcgibbon closed 5 years ago
mime-types uses the same logic to classify binary?/ascii? network transfer encoding; curious that these differ. Which MIME type does MIME::Types.of("a.css").first
return?
(The method names are confusing here. This isn't indicating that the type itself is binary/ascii, but whether the type needs transfer encoding for non-8-bit-clean channels, such as attaching to an email message.)
👋 I'm converting some code to use
mini_mime
instead ofmime-types
and I noticed a strange inconsistency in how types are labelled as binary. Here's the difference:In
mime-types
:MIME::Types.of("a.css").first.binary? #=> false
Inmini_mime
:MiniMime.lookup_by_filename("a.css").binary? #> true
This also happens with all other types that are labelled as
8bit
encoding in the db file. I think this line might be wrong.Side note: it might also be cool to add a
#ascii?
method to check for non-binary encodings.