Uploaded image for project: 'Tika'
  1. Tika
  2. TIKA-942

HTTP Accept header evaluator

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • None
    • None
    • mime

    Description

      The HTTP Accept header (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html) provides a flexible mechanism for an HTTP client to express its preferences for different response media types. Unfortunately processing Accept headers on the server side is quite complicated because of the somewhat complicated syntax and the possibility of media type inheritance relationships (can I respond with application/xml if the client requests text/plain?).

      The media type registry in Tika is perfect for resolving such cases, so I'd like to introduce a new String resolveHttpAccept(String accept, String... types) method in the Tika facade. The method would take the value of an HTTP accept header and evaluate it against the given media types supported by a server, using the configured media type registry for type inheritance information. The method would then return the best match from among the given media types, or application/octet-stream if none of the listed types would be accepted by the client.

      Attachments

        Activity

          People

            Unassigned Unassigned
            jukkaz Jukka Zitting
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: