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 to "text/javascript" #79056

Closed
MylesBorins mannequin opened this issue Oct 2, 2018 · 9 comments
Closed

Change .js mime to "text/javascript" #79056

MylesBorins mannequin opened this issue Oct 2, 2018 · 9 comments
Labels
3.10 only security fixes 3.11 only security fixes 3.12 bugs and security fixes stdlib Python modules in the Lib dir topic-email

Comments

@MylesBorins
Copy link
Mannequin

MylesBorins mannequin commented Oct 2, 2018

BPO 34875
Nosy @asvetlov, @ammaraskar, @MylesBorins, @180909, @arhadthedev
PRs
  • bpo-34875: change .js mimetype to text/javascript #9678
  • bpo-34875:Change .js and .mjs mime to text/javascript #30740
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = None
    created_at = <Date 2018-10-02.22:28:39.501>
    labels = ['library', '3.9', '3.10', '3.11']
    title = 'Change .js mime to "text/javascript"'
    updated_at = <Date 2022-01-21.11:06:31.601>
    user = 'https://github.com/MylesBorins'

    bugs.python.org fields:

    activity = <Date 2022-01-21.11:06:31.601>
    actor = 'arhadthedev'
    assignee = 'none'
    closed = False
    closed_date = None
    closer = None
    components = ['Library (Lib)']
    creation = <Date 2018-10-02.22:28:39.501>
    creator = 'mylesborins'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 34875
    keywords = ['patch']
    message_count = 7.0
    messages = ['326920', '326923', '327006', '327007', '327010', '345883', '411109']
    nosy_count = 5.0
    nosy_names = ['asvetlov', 'ammar2', 'mylesborins', 'wangjiahua', 'arhadthedev']
    pr_nums = ['9678', '30740']
    priority = 'normal'
    resolution = None
    stage = 'patch review'
    status = 'open'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue34875'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @MylesBorins
    Copy link
    Mannequin Author

    MylesBorins mannequin commented Oct 2, 2018

    I propose to change the mapping of file extension .js to mime type "text/javascript" from "application/javascript.

    "text/javascript" is the currently documented best practice in the whatwg HTML spec.

    https://html.spec.whatwg.org/multipage/scripting.html#scriptingLanguages:javascript-mime-type

    @MylesBorins MylesBorins mannequin added 3.7 (EOL) end of life 3.8 (EOL) end of life stdlib Python modules in the Lib dir labels Oct 2, 2018
    @ammaraskar
    Copy link
    Member

    It should be noted that the HTML spec also says:

    The term "JavaScript" is used to refer to ECMA-262, rather than the official term ECMAScript, since the term JavaScript is more widely known. Similarly, the MIME type used to refer to JavaScript in this specification is text/javascript, since that is the most commonly used type, despite it being an officially obsoleted type according to RFC 4329.

    https://html.spec.whatwg.org/#dependencies:willful-violation

    @asvetlov asvetlov changed the title Change .js mime to "test/javascript" Change .js mime to "text/javascript" Oct 3, 2018
    @asvetlov
    Copy link
    Contributor

    asvetlov commented Oct 3, 2018

    By RCF 4329 https://tools.ietf.org/html/rfc4329#page-9 text/javascript is obsoleted, application/javascript is a part of the standard.

    WhatWg is a controversial group. Their specs don't always follow official standards but Python does.

    Sorry, I should decline the proposal.

    Feel free to raise an issue again if IETF will change their opinion.

    @asvetlov asvetlov closed this as completed Oct 3, 2018
    @MylesBorins
    Copy link
    Mannequin Author

    MylesBorins mannequin commented Oct 3, 2018

    There is a IETF proposal that would make "text/javascript" no longer obsolete.

    Will revisit at the point this lands

    https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/

    @asvetlov
    Copy link
    Contributor

    asvetlov commented Oct 3, 2018

    We can return to the question when (and if) the draft will be accepted.

    @MylesBorins
    Copy link
    Mannequin Author

    MylesBorins mannequin commented Jun 17, 2019

    Hey All,

    I'd like to reopen this. We are almost done with the IETF standardization of .mjs, and part of this process is making obsolete application/javascript in favor of text/javascript.

    --> https://datatracker.ietf.org/doc/draft-ietf-dispatch-javascript-mjs/

    @MylesBorins MylesBorins mannequin reopened this Jun 17, 2019
    @iritkatriel iritkatriel added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes and removed 3.7 (EOL) end of life 3.8 (EOL) end of life labels Jan 17, 2022
    @arhadthedev
    Copy link
    Member

    Myles, it looks like the draft 14 contains a mismatch in 6.2.1:

    6.2.1. text/ecmascript

    Type name: application
    Subtype name: ecmascript

    In header it's text, in details it's application. Is it intended?

    I believe that a typo wouldn't pass though fourteen revisions but nevertheless, just to be safe.

    @mathiasbynens
    Copy link

    Following up to this old thread + this earlier discussion: RFC 9239 now unequivocally resolves this disagreement. Patch: #92627

    @AA-Turner AA-Turner added 3.12 bugs and security fixes topic-email and removed 3.9 only security fixes labels May 27, 2022
    @encukou
    Copy link
    Member

    encukou commented Mar 26, 2024

    This was reported later in #97646, and changed in #97934 (Python 3.12).

    @encukou encukou closed this as completed Mar 26, 2024
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.10 only security fixes 3.11 only security fixes 3.12 bugs and security fixes stdlib Python modules in the Lib dir topic-email
    Projects
    None yet
    Development

    No branches or pull requests

    7 participants