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

support application/wasm in mimetypes and http.server #79584

Closed
pmp-p mannequin opened this issue Dec 4, 2018 · 5 comments
Closed

support application/wasm in mimetypes and http.server #79584

pmp-p mannequin opened this issue Dec 4, 2018 · 5 comments
Labels
3.8 only security fixes type-feature A feature request or enhancement

Comments

@pmp-p
Copy link
Mannequin

pmp-p mannequin commented Dec 4, 2018

BPO 35403
Nosy @stevendaprano, @bitdancer, @pmp-p, @vadmium
Superseder
  • bpo-34758: http.server module sets incorrect mimetype for WebAssembly files
  • 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 = <Date 2019-03-30.23:25:39.556>
    created_at = <Date 2018-12-04.08:14:04.923>
    labels = ['type-feature', '3.8']
    title = 'support application/wasm in mimetypes and http.server'
    updated_at = <Date 2019-03-30.23:27:42.216>
    user = 'https://github.com/pmp-p'

    bugs.python.org fields:

    activity = <Date 2019-03-30.23:27:42.216>
    actor = 'martin.panter'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-03-30.23:25:39.556>
    closer = 'martin.panter'
    components = []
    creation = <Date 2018-12-04.08:14:04.923>
    creator = 'pmpp'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35403
    keywords = []
    message_count = 5.0
    messages = ['331015', '331016', '331528', '331644', '339230']
    nosy_count = 4.0
    nosy_names = ['steven.daprano', 'r.david.murray', 'pmpp', 'martin.panter']
    pr_nums = []
    priority = 'normal'
    resolution = 'out of date'
    stage = 'resolved'
    status = 'closed'
    superseder = '34758'
    type = 'enhancement'
    url = 'https://bugs.python.org/issue35403'
    versions = ['Python 3.8']

    @pmp-p
    Copy link
    Mannequin Author

    pmp-p mannequin commented Dec 4, 2018

    web browsers have recently gained ability to run webassembly code and for that a new content type has to be add to web servers for optimal use:

    wasm => Content-Type header : application/wasm

    spec says it :
    https://webassembly.github.io/spec/web-api/index.html#streaming-modules

    "Firefox streaming compilation needs Content-Type header set"

    cf: https://groups.google.com/forum/#!topic/emscripten-discuss/C7-i1gqWay4

    google's filament documentation says:
    "Python's simple server [...] does not serve WebAssembly files with the correct MIME type."

    it would be logical since simple htt server is mostly used for testing software to offer support of that new techonology.

    @pmp-p pmp-p mannequin added 3.7 (EOL) end of life 3.8 only security fixes type-feature A feature request or enhancement labels Dec 4, 2018
    @stevendaprano
    Copy link
    Member

    Python 3.7 is in feature-freeze, so any new features like this will have to be 3.8 only.

    @stevendaprano stevendaprano removed the 3.7 (EOL) end of life label Dec 4, 2018
    @bitdancer
    Copy link
    Member

    We don't generally add a mime type until it is a de-jure or de-facto standard. If it is still in testing it is probably too soon to add it. For testing, you can always add it yourself in your code via the api that mimetypes provides.

    @pmp-p
    Copy link
    Mannequin Author

    pmp-p mannequin commented Dec 11, 2018

    Sure, but i was considering the cpython in the browser/webview/electron case where python modules are served as .wasm files, i'm about to do it for my port and pyodide already does.
    It would make sense to provide the *simplest* environnement for cpython to serve its own components.

    scientific cpython stack in the browser:
    https://github.com/iodide-project/pyodide

    python repl in the browser experiment:
    http://pmpp.pagesperso-orange.fr/python_em.html

    Also i think cpython in the browser could be be already beyond testing and so far provides the best sandboxing configuration available around :
    "run python in a sandbox, not the opposite" ( quoting Victor Stinner )

    @vadmium
    Copy link
    Member

    vadmium commented Mar 30, 2019

    According to bpo-34758, this was already added to 3.8’s “mimetypes”.

    @vadmium vadmium closed this as completed Mar 30, 2019
    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.8 only security fixes type-feature A feature request or enhancement
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants