You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tika.apache.org by "marcospereira (via GitHub)" <gi...@apache.org> on 2024/01/23 19:11:00 UTC

[PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript to follow RFC-9239 [tika]

marcospereira opened a new pull request, #1556:
URL: https://github.com/apache/tika/pull/1556

   ## What
   
   Fixes [TIKA-4119](https://issues.apache.org/jira/browse/TIKA-4119).
   
   Additionally, I've added support for ".mjs" files, as documented in the RFC:
   
   > Additional information:
   >
   > Deprecated alias names for this type: application/javascript, application/x-javascript, text/javascript1.0, text/javascript1.1, text/javascript1.2, text/javascript1.3, text/javascript1.4, text/javascript1.5, text/jscript, text/livescript
   > 
   > Magic number(s): N/A
   > **File extension(s): .js, .mjs**
   > Macintosh File Type Code(s): TEXT
   
   
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on code in PR #1556:
URL: https://github.com/apache/tika/pull/1556#discussion_r1463958645


##########
tika-core/src/test/java/org/apache/tika/mime/MimeTypesReaderTest.java:
##########


Review Comment:
   Y, same.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "marcospereira (via GitHub)" <gi...@apache.org>.
marcospereira commented on PR #1556:
URL: https://github.com/apache/tika/pull/1556#issuecomment-1907174771

   Alright, it should be good now. At least all the tests passed twice when running on my machine. :-)


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "marcospereira (via GitHub)" <gi...@apache.org>.
marcospereira commented on PR #1556:
URL: https://github.com/apache/tika/pull/1556#issuecomment-1906786972

   @tballison, thanks for the quick review. This should be in a better state now.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on PR #1556:
URL: https://github.com/apache/tika/pull/1556#issuecomment-1908421415

   Thank you, @marcospereira !


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on code in PR #1556:
URL: https://github.com/apache/tika/pull/1556#discussion_r1463871190


##########
tika-core/src/test/java/org/apache/tika/mime/MimeTypesReaderTest.java:
##########


Review Comment:
   Better not to include the whitespace changes unrelated to the javascript issue. No need to modify, though. I'm guilty of this too occasionally. LOL...
   
   Same goes for the improvements to the minShouldMatch tests



##########
README.md:
##########
@@ -20,7 +20,7 @@ Tika jars can be fetched from Maven Central or your favourite Maven mirror.
 
 **Tika 1.X reached End of Life (EOL) on September 30, 2022.**  
 
-Tika is based on **Java 8** and uses the [Maven 3](https://maven.apache.org) build system. 
+Tika is based on **Java 11** and uses the [Maven 3](https://maven.apache.org) build system. 

Review Comment:
   Probably better in a separate commit, but let's leave it. Same goes for other improvements in this file.



##########
tika-core/src/test/java/org/apache/tika/mime/ProbabilisticMimeDetectionTest.java:
##########
@@ -135,7 +136,7 @@ private void testFile(String expected, String filename) throws IOException {
 
     private void testStream(String expected, String urlOrFileName, InputStream in)
             throws IOException {
-        assertNotNull("Test stream: [" + urlOrFileName + "] is null!", in);
+        assertNotNull(in, "Test stream: [" + urlOrFileName + "] is null!");

Review Comment:
   This is a bug which we'll fix in main separately. Let's revert this here.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on code in PR #1556:
URL: https://github.com/apache/tika/pull/1556#discussion_r1463954328


##########
tika-core/src/test/java/org/apache/tika/mime/ProbabilisticMimeDetectionTest.java:
##########
@@ -135,7 +136,7 @@ private void testFile(String expected, String filename) throws IOException {
 
     private void testStream(String expected, String urlOrFileName, InputStream in)
             throws IOException {
-        assertNotNull("Test stream: [" + urlOrFileName + "] is null!", in);
+        assertNotNull(in, "Test stream: [" + urlOrFileName + "] is null!");

Review Comment:
   Ha, right, the tests pass because our current test is "is the warning message not null", and in fact, the warning message is not null. LOL...



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison merged PR #1556:
URL: https://github.com/apache/tika/pull/1556


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "marcospereira (via GitHub)" <gi...@apache.org>.
marcospereira commented on code in PR #1556:
URL: https://github.com/apache/tika/pull/1556#discussion_r1463890809


##########
tika-core/src/test/java/org/apache/tika/mime/ProbabilisticMimeDetectionTest.java:
##########
@@ -135,7 +136,7 @@ private void testFile(String expected, String filename) throws IOException {
 
     private void testStream(String expected, String urlOrFileName, InputStream in)
             throws IOException {
-        assertNotNull("Test stream: [" + urlOrFileName + "] is null!", in);
+        assertNotNull(in, "Test stream: [" + urlOrFileName + "] is null!");

Review Comment:
   Got it. Let me reorganize the commits and remove this now. The tests passed with no issues on my machine, though.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "marcospereira (via GitHub)" <gi...@apache.org>.
marcospereira commented on code in PR #1556:
URL: https://github.com/apache/tika/pull/1556#discussion_r1463889449


##########
tika-core/src/test/java/org/apache/tika/mime/MimeTypesReaderTest.java:
##########


Review Comment:
   It was not intentional. The code editor formatted the code automatically. 😬 



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "marcospereira (via GitHub)" <gi...@apache.org>.
marcospereira commented on PR #1556:
URL: https://github.com/apache/tika/pull/1556#issuecomment-1908850994

   > Thank you, @marcospereira !
   
   Thank you, @tballison. I see https://issues.apache.org/jira/browse/TIKA-4119 is still marked as "open". Is there something I need to do on my end or is it just out of sync with the changes here?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "tballison (via GitHub)" <gi...@apache.org>.
tballison commented on PR #1556:
URL: https://github.com/apache/tika/pull/1556#issuecomment-1906907783

   ``` 
   Failures: 
   Error:    TestMimeTypes.testCodeFormats:1151->assertTypeByName:1385 expected: <application/javascript> but was: <text/javascript>
   Error:    TestMimeTypes.testTextBasedFormatsDetection:721->assertTypeByName:1385 expected: <application/javascript> but was: <text/javascript>```
    Doh Something went wrong in the tests.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 [tika]

Posted by "marcospereira (via GitHub)" <gi...@apache.org>.
marcospereira commented on code in PR #1556:
URL: https://github.com/apache/tika/pull/1556#discussion_r1463888582


##########
README.md:
##########
@@ -20,7 +20,7 @@ Tika jars can be fetched from Maven Central or your favourite Maven mirror.
 
 **Tika 1.X reached End of Life (EOL) on September 30, 2022.**  
 
-Tika is based on **Java 8** and uses the [Maven 3](https://maven.apache.org) build system. 
+Tika is based on **Java 11** and uses the [Maven 3](https://maven.apache.org) build system. 

Review Comment:
   Oh, it was in a separate commit before, but the pull request template recommends squashing all the changes. I can easily split this if you want. :-)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@tika.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org