#26 ✓hold
Ryan Tomayko

Add support for Accept header parsing and matching

Reported by Ryan Tomayko | February 1st, 2009 @ 06:38 AM | in 1.x

There is a simple, MIT licensed mimeparse library that handles parsing Accept header values and determining the relative strength of a given response content-type:

http://code.google.com/p/mimepar...

We should integrate this code into Rack::Response, Rack::Utils, or Rack::Mime so that we can provide good support for Accept header parsing in core.

Additional discussion about this on the ML:

http://groups.google.com/group/r...

Comments and changes to this ticket

  • SSDany

    SSDany July 25th, 2009 @ 10:49 PM

    http://gist.github.com/155055 - some parsers.

    HTTP_ACCEPT parsers are based on webrick (parse_qvalues) and mimeparse.py (ruby version cant satisfy some edge cases, EG, returns the last one of provides, when HTTP_ACCEPT header is a full wildcard, and so on).

    HTTPAcceptParsers::detect_best_encoding works like Rack::Utils::select_best_encoding, but a little bit faster.

    All this code is not solid, of course, but could be helpful (I hope).
    Anyway, it would be very nice to see rfc-ish HTTP_ACCEPT(_...) support in core.

  • josh

    josh August 3rd, 2009 @ 04:11 PM

    • State changed from “new” to “open”
    • Milestone changed from 1.0 to 1.1
  • josh

    josh December 11th, 2009 @ 03:10 AM

    • Milestone changed from 1.1 to 1.x
  • raggi

    raggi May 3rd, 2011 @ 07:57 AM

    • State changed from “open” to “hold”
    • Milestone order changed from “0” to “0”

    hold for patch.

Please Sign in or create a free account to add a new ticket.

With your very own profile, you can contribute to projects, track your activity, watch tickets, receive and update tickets through your email and much more.

New-ticket Create new ticket

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

People watching this ticket

Pages