You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "Daniel Goltz (JIRA)" <ji...@apache.org> on 2017/12/18 10:27:02 UTC

[jira] [Comment Edited] (TIKA-1141) javascript files that contain "
    [ https://issues.apache.org/jira/browse/TIKA-1141?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16294760#comment-16294760 ] 

Daniel Goltz edited comment on TIKA-1141 at 12/18/17 10:26 AM:
---------------------------------------------------------------

[~gagravarr],
I ran

{code:java}
java -jar apache-tika-1.17.jar
{code}

and then dropped the file into the UI and got "text/html"

Also, Tika 1.14 is used in [windows-azure-storage-plugin|https://github.com/jenkinsci/windows-azure-storage-plugin] and we get "text/html" [there|https://github.com/jenkinsci/windows-azure-storage-plugin/blob/7f4fae6240e7cf0dd1b24d6aa3c0ceb3d2bba317/src/main/java/com/microsoftopentechnologies/windowsazurestorage/AzureBlobProperties.java]:

{code:java}
Tika tika = new Tika();
try (InputStream stream = file.read()) {
     return tika.detect(stream, file.getName());
}
{code}

I have opened a [bug|https://github.com/jenkinsci/windows-azure-storage-plugin/issues/89] in windows-azure-storage-plugin as this doesn't work


was (Author: dagoltz):
[~gagravarr],
I ran

{code:java}
java -jar apache-tika-1.17.jar
{code}

and then dropped the file into the UI and got "text/html"


> javascript files that contain "<html" are detected as text/html
> ---------------------------------------------------------------
>
>                 Key: TIKA-1141
>                 URL: https://issues.apache.org/jira/browse/TIKA-1141
>             Project: Tika
>          Issue Type: Bug
>          Components: mime
>    Affects Versions: 1.2
>            Reporter: David Hara
>            Priority: Minor
>
> The Mimetypes detector will return text/html as the mimetype for any javascript file that contains the string "<html" in it. I believe this is due to the rule <match value="&lt;html" type="string" offset="0:8192"/> in the tika-mimetypes.xml file.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)