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

Change .js MIME type to text/javascript #40771

Merged
merged 1 commit into from
Mar 23, 2022

Conversation

adityamandaleeka
Copy link
Member

@adityamandaleeka adityamandaleeka commented Mar 18, 2022

Fix #34323

This changes the MIME type for .js to text/javascript, and updates response compression to include text/javascript as well.

I also added .mjs to the copy of FileExtensionContentTypeProvider.cs that's in WebView sources, which seems to have been missed in #34318.

See:
https://datatracker.ietf.org/doc/html/draft-ietf-dispatch-javascript-mjs
https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages

@@ -152,7 +152,7 @@ public FileExtensionContentTypeProvider()
{ ".jpe", "image/jpeg" },
{ ".jpeg", "image/jpeg" },
{ ".jpg", "image/jpeg" },
{ ".js", "application/javascript" },
{ ".js", "text/javascript" },
Copy link
Member

Choose a reason for hiding this comment

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

@dotnet/dotnet-maui-blazor-eng - we need to verify this works in all the WebViews. I'd be very surprised if it doesn't, but we need to positively verify that it does.

Copy link
Member

Choose a reason for hiding this comment

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

In particular, things like older Androids with older Chromes, which we do still support.

Copy link
Member Author

Choose a reason for hiding this comment

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

@Eilon Makes sense. I'm not familiar with your test infrastructure for that stuff; would someone on your team be able to do that test pass before this PR is merged, or would this be picked up post-merge? I'm happy to hold off on merging this if needed, just let me know how to proceed :).

Copy link
Member

Choose a reason for hiding this comment

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

Pinging @TanayParikh @javiercn @MackinnonBuck who can help you with this.

Copy link
Member Author

Choose a reason for hiding this comment

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

Spoke offline, thanks all!

@adityamandaleeka adityamandaleeka merged commit 8d6554e into dotnet:main Mar 23, 2022
@ghost ghost added this to the 7.0-preview3 milestone Mar 23, 2022
@dougbu dougbu modified the milestones: 7.0-preview3, 7.0-preview4 Apr 5, 2022
brettfo added a commit to dotnet/interactive that referenced this pull request Nov 9, 2022
The default MIME type for `.js` files changed to `text/javascript` in
dotnet/aspnetcore#40771 so the test needed to be updated, too.
dotnet-maestro bot added a commit to dotnet/interactive that referenced this pull request Nov 16, 2022
[main] Update dependencies from dotnet/arcade


 - update to run on dotnet 7

 - update to stable sdk

 - update mime type to align with new value

The default MIME type for `.js` files changed to `text/javascript` in
dotnet/aspnetcore#40771 so the test needed to be updated, too.

 - update minimum sdk version for vscode extension

 - Merge remote-tracking branch 'upstream/main' into darc-main-f75372cd-0832-40a1-95fc-5022c8550314

 - update test package versions

 - add linux test retry

 - don't fail build on docker build failures

 - update test command

 - run tests one assembly at a time

 - update extension lab packages

 - skip ildasm test

 - improve log message

 - log errors

 - run tests on a class-by-class basis
@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware and removed area-runtime labels Jun 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlesware
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Change MIME type for .js extension to text/javascript
6 participants