Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged

Conversation

marcospereira
Copy link
Contributor

What

Fixes 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

@marcospereira marcospereira changed the title [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript to follow RFC-9239 [TIKA-4119]: Return media type "text/javascript" instead of "application/javascript" to follow RFC-9239 Jan 23, 2024
@marcospereira marcospereira force-pushed the issues/4119/rfc-9239-js-mime-type branch from 5e7c9fe to 31d26ab Compare January 23, 2024 19:13
Copy link
Contributor

@tballison tballison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall, this looks great. As noted, there are a couple of changes that are unrelated to the goal of the PR. Thank you!

README.md Show resolved Hide resolved
@marcospereira marcospereira force-pushed the issues/4119/rfc-9239-js-mime-type branch from 31d26ab to 4f14ca9 Compare January 23, 2024 19:30
@marcospereira
Copy link
Contributor Author

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

@tballison
Copy link
Contributor

tballison commented Jan 23, 2024

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.

@marcospereira
Copy link
Contributor Author

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

@tballison tballison merged commit ae737cd into apache:main Jan 24, 2024
1 check passed
@tballison
Copy link
Contributor

Thank you, @marcospereira !

@marcospereira marcospereira deleted the issues/4119/rfc-9239-js-mime-type branch January 24, 2024 20:15
@marcospereira
Copy link
Contributor Author

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants