You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Tyler Palsulich (JIRA)" <ji...@apache.org> on 2015/03/14 04:13:38 UTC

[jira] [Closed] (TIKA-942) HTTP Accept header evaluator

     [ https://issues.apache.org/jira/browse/TIKA-942?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Tyler Palsulich closed TIKA-942.
--------------------------------
    Resolution: Won't Fix

Closing as Won't Fix, since the JAX-RS implementation automatically handles this.

> HTTP Accept header evaluator
> ----------------------------
>
>                 Key: TIKA-942
>                 URL: https://issues.apache.org/jira/browse/TIKA-942
>             Project: Tika
>          Issue Type: New Feature
>          Components: mime
>            Reporter: Jukka Zitting
>              Labels: HTTP
>
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)