You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tika.apache.org by ta...@apache.org on 2024/10/24 16:01:21 UTC

(tika) branch branch_3x updated: [TIKA-4336] Fix parent of `application/json` MIME type (#2010)

This is an automated email from the ASF dual-hosted git repository.

tallison pushed a commit to branch branch_3x
in repository https://gitbox.apache.org/repos/asf/tika.git


The following commit(s) were added to refs/heads/branch_3x by this push:
     new c25a57317 [TIKA-4336] Fix parent of `application/json` MIME type (#2010)
c25a57317 is described below

commit c25a57317bc01654d65cd1daeeea364aaf232984
Author: Valery Yatsynovich <va...@gmail.com>
AuthorDate: Thu Oct 24 19:00:45 2024 +0300

    [TIKA-4336] Fix parent of `application/json` MIME type (#2010)
    
    (cherry picked from commit d6efcd8e82109bd3740f5c313d54903b7db67daa)
---
 tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml | 2 +-
 tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java  | 3 +++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
index b7134faf8..87cc7aae8 100644
--- a/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
+++ b/tika-core/src/main/resources/org/apache/tika/mime/tika-mimetypes.xml
@@ -404,7 +404,7 @@
   </mime-type>
 
   <mime-type type="application/json">
-    <sub-class-of type="application/javascript"/>
+    <sub-class-of type="text/javascript"/>
     <glob pattern="*.json"/>
   </mime-type>
 
diff --git a/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java b/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
index 84820ac94..6e844a0bf 100644
--- a/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
+++ b/tika-core/src/test/java/org/apache/tika/mime/MimeDetectionTest.java
@@ -156,6 +156,9 @@ public class MimeDetectionTest {
 
         assertTrue(REGISTRY.isSpecializationOf(MediaType.parse("application/vnd.apple.iwork"),
                 MediaType.APPLICATION_ZIP));
+
+        assertTrue(REGISTRY.isSpecializationOf(MediaType.parse("application/json"),
+                MediaType.TEXT_PLAIN));
     }
 
     @SuppressWarnings("unused")