feat: enable WebAssembly.instantiateStreaming and wasm async compilation (#11200)

The WebAssembly streaming APIs used to be enabled, but used to take
buffer sources as their first argument (see #6154 and #7259). This
change re-enables them, requiring a Promise<Response> instead, as well as
enabling asynchronous compilation of WebAssembly modules.
This commit is contained in:
Andreu Botella 2021-07-03 23:33:36 +02:00 committed by GitHub
parent 7ef0f43d87
commit ffa75be480
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 351 additions and 24 deletions

View file

@ -948,6 +948,8 @@ fn custom_headers(p: &str, body: Vec<u8>) -> Response<Body> {
Some("application/javascript")
} else if p.ends_with(".json") {
Some("application/json")
} else if p.ends_with(".wasm") {
Some("application/wasm")
} else {
None
};