Issue 35403: support application/wasm in mimetypes and http.server (original) (raw)

Created on 2018-12-04 08:14 by pmpp, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (5)
msg331015 - (view) Author: pmp-p (pmpp) * Date: 2018-12-04 08:14
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.
msg331016 - (view) Author: Steven D'Aprano (steven.daprano) * (Python committer) Date: 2018-12-04 08:24
Python 3.7 is in feature-freeze, so any new features like this will have to be 3.8 only.
msg331528 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2018-12-10 17:53
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.
msg331644 - (view) Author: pmp-p (pmpp) * Date: 2018-12-11 18:46
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 )
msg339230 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2019-03-30 23:25
According to Issue 34758, this was already added to 3.8’s “mimetypes”.
History
Date User Action Args
2022-04-11 14:59:08 admin set github: 79584
2019-03-30 23:27:42 martin.panter set superseder: http.server module sets incorrect mimetype for WebAssembly files
2019-03-30 23:25:39 martin.panter set status: open -> closednosy: + martin.pantermessages: + resolution: out of datestage: resolved
2018-12-11 18:46:05 pmpp set messages: +
2018-12-10 17:53:21 r.david.murray set messages: +
2018-12-07 22:34:39 terry.reedy set nosy: + r.david.murray
2018-12-04 08:24:53 steven.daprano set nosy: + steven.dapranomessages: + versions: - Python 3.7
2018-12-04 08:14:04 pmpp create