-
Notifications
You must be signed in to change notification settings - Fork 22.8k
fix(text/javascript): Clarify charset validity in HTTP vs HTML contex… #40100
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
Conversation
Preview URLs Flaws (3)URL:
External URLs (4)URL:
(comment last updated: 2025-07-04 10:49:08) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! The point of the original was pretty clear: the only allowed mime type is text/javascript
- you shouldn't serve all those other types listed below in the section "Legacy JavaScript MIME types".
That is completely true ^^^, because charset
is not a mime type - its an optional parameter to the MIME type. Splitting hairs of course, but to my mind the charset issue is a really minor side point to the mime type, so we should keep that first and forefront.
The way I would handle this is to treat it as such. Start with the original text, then have a comment about where you can and cannot use the charset
parameter with the mime type.
Does that make sense?
@Josh-Cena FYI - you had a comment on the linked issue.
Yeah this PR shifts the focus to the wrong part. I would simply remove the second paragraph, and mention "MIME type essence" somewhere else other than under |
Thank you @Josh-Cena and @hamishwillee for the helpful feedback. I have now made the following updates:
Let me know if --
Thanks again for guiding this, I really appreciate your time and support! - |
I will let Hamish continue with the review, but (a) this is not the right place to put it because we are listing MIME types under this section (b) you still didn't remove the incorrect paragraph in the original report. |
… MIME essence usage
Removed additional extra space Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
22e12a4
to
862f4ad
Compare
Thanks. I have subedit this to my taste - essentially rewording so that the essence stuff is part of the JS section, where the error was reported. The previous section added wasn't in the right place IMO (it was about how mime types are used, not "an important MIME type". It also generalized to style types what is about script types - this might apply to styles, but if so, I'd add it to that section. @Josh-Cena You might want to sanity check this too. If not, I will do so on Monday when I have objectivity again. |
Thanks for the updated wording. Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
Co-authored-by: Joshua Chen <sidachen2003@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @Shrinivassab @Josh-Cena !
Description
Updated text/javascript MIME type docs to clarify that charset is valid in HTTP headers.
Motivation
Fixes incorrect documentation that claimed charset is always invalid.
Additional details
Related issues and pull requests
Fixes #39505