The entire lib is 216 lines with tests and supports parsing complex
Accept headers with, e.g., q= values and other parameters. There's also
irb> best_match(["application/xbel+xml", "text/xml"],
I'll work with bct to get a patch together and open a ticket. In the
meantime, any thoughts?
Some of that code could be generalized to also handle Accept-Encoding.
I took a look at MIMEParse when I wrote Rack::Deflater and IIRC all of
the functions are implemented in terms of parse_mime_type which
understands strings like "text/html" but not encoding names like
"gzip". If that could be parameterized, then I think most of
Rack::Utils.select_best_encoding could be thrown out.
> I'll work with bct to get a patch together and open a ticket. In the
> meantime, any thoughts?
+1, I have a stipped down version in coset, but let's import the whole
thing if possible.