[ 
https://issues.apache.org/jira/browse/TIKA-942?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14343308#comment-14343308
 ] 

Tyler Palsulich commented on TIKA-942:
--------------------------------------

Hi [~jukkaz], it looks like we now automatically filter based on the requested 
type? So, would this be a utility method for end users, or something to use 
internally? I'll close as Won't Fix later this week unless you say otherwise.

> 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)

Reply via email to