rest-client/rest-client — pull request #248 by IanVaughan (2013-11-06 13:48:07+00:00)
Title: Ensure returned mime type returned is not obsolete

The mime-types gem [sorts (via `priority_compare`)][2] obsolete [types first][3] in the return Array, so using the last element ensures that if an active type is present, it is returned here.

An example usage of where this showed up incorrect was the `csv` format, which incorrectly returned the obsolete value [`text/comma-separated-values`][1].

[1]:https://github.com/halostatue/mime-types/blob/master/type-lists/text.yaml#L30
[2]:https://github.com/halostatue/mime-types/blob/master/lib/mime/types.rb#L169
[3]:https://github.com/halostatue/mime-types/blob/master/lib/mime/type.rb#L162