tika-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Hudson (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (TIKA-2648) mime detection based on resource name detects resources as "text/x-php" instead of "text/html"
Date Fri, 03 Aug 2018 16:48:00 GMT

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

Hudson commented on TIKA-2648:
------------------------------

UNSTABLE: Integrated in Jenkins build tika-2.x-windows #292 (See [https://builds.apache.org/job/tika-2.x-windows/292/])
TIKA-2648 detect interpreted server-side script languages (gbouchar: rev 536df9ce90a18ea6e8827e704e54afe162719953)
* (edit) tika-core/src/main/java/org/apache/tika/mime/MimeType.java
* (edit) tika-core/src/test/java/org/apache/tika/mime/CustomReaderTest.java
* (edit) tika-core/src/test/resources/org/apache/tika/mime/custom-mimetypes2.xml
* (edit) tika-core/src/main/java/org/apache/tika/mime/MimeTypes.java
* (edit) tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
* (edit) tika-core/src/main/java/org/apache/tika/mime/MimeTypesReader.java
* (edit) tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
* (edit) tika-core/src/main/java/org/apache/tika/mime/MimeTypesReaderMetKeys.java


> mime detection based on resource name detects resources as "text/x-php" instead of "text/html"

> -----------------------------------------------------------------------------------------------
>
>                 Key: TIKA-2648
>                 URL: https://issues.apache.org/jira/browse/TIKA-2648
>             Project: Tika
>          Issue Type: Bug
>            Reporter: Gerard Bouchar
>            Priority: Major
>
> When using tika to detect a mime type given only an URL containing ".php" and a content-type
hint of "text/html", it guesses "text/x-php", whereas one could expect "text/html".
> {code}
> TikaConfig tika = new TikaConfig();
> Metadata metadata = new Metadata();
> String url = "https://www.facebook.com/home.php";
> metadata.set(Metadata.RESOURCE_NAME_KEY, url);
> metadata.set(Metadata.CONTENT_TYPE, "text/html");
> MediaType type = tika.getDetector().detect(null, metadata);
> System.out.println(url + " is of type " + type.toString());
> // Prints https://www.facebook.com/home.php is of type text/x-php
> {code}



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Mime
View raw message