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

[jira] [Reopened] (TIKA-1519) Don't allow whatever is in http-equiv Content-Type to overwrite actual Content-Type in HtmlParser

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

Tim Allison reopened TIKA-1519:
-------------------------------

The fix for this led to ignoring valid encoding detection when the overall id was identified as {{application/xhtml+xml}}.

{noformat}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
{noformat}

In Tika 1.7, they used to have a Content-Type of: {{text/html; charset=iso-8859-1}} 

In Tika 1.8-rc1, they now have a Content-Type of: {{application/xhtml+xml}}

We should fix this so that we aren't losing valid information in the {{meta}} header.

> Don't allow whatever is in http-equiv Content-Type to overwrite actual Content-Type in HtmlParser
> -------------------------------------------------------------------------------------------------
>
>                 Key: TIKA-1519
>                 URL: https://issues.apache.org/jira/browse/TIKA-1519
>             Project: Tika
>          Issue Type: Bug
>    Affects Versions: 1.6
>            Reporter: Tim Allison
>            Priority: Trivial
>             Fix For: 1.8
>
>
> The HtmlParser will overwrite the value of Content-Type in Metadata with any value of content in an http-equiv=Content-Type header, e.g.
> {noformat}
> <meta http-equiv=Content-Type content="blah de blah blah">{noformat}.
> or even worse, perhaps:
> <meta http-equiv=Content-Type content="application/pdf">
> Let's capture the content type alleged by the html file in a different key from Content-Type; I'd prefer to reserve Content-Type for "text/html; charset=X".
> Candidate key/Property: Content-Type-Meta-HTTP-Equiv?
> See TIKA-1514 for example output.



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