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

feat(wasm): Support WebAssembly.instantiateStreaming for file fetches #12901

Merged
merged 1 commit into from
Nov 26, 2021

Conversation

andreubotella
Copy link
Contributor

Fetching of local files, added in #12545, returns a response with no headers, including the Content-Type header. This currently makes it not work with the WebAssembly streaming APIs, which require the response to have a content type of application/wasm.

Since the only way to obtain a Response object with a non-empty url field is via fetch(), this change changes the content type requirement to only apply to responses whose url has the file: scheme.

Fetching of local files, added in denoland#12545, returns a response with no
headers, including the `Content-Type` header. This currently makes it
not work with the WebAssembly streaming APIs, which require the response
to have a content type of `application/wasm`.

Since the only way to obtain a `Response` object with a non-empty `url`
field is via `fetch()`, this change changes the content type requirement
to only apply to responses whose url has the `file:` scheme.
Copy link
Contributor

@kitsonk kitsonk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but would like to get @lucacasonato opinion on it.

@kitsonk kitsonk requested a review from lucacasonato November 26, 2021 05:21
@kitsonk kitsonk merged commit d763633 into denoland:main Nov 26, 2021
@andreubotella andreubotella deleted the wasm-streaming-with-file-fetch branch November 26, 2021 11:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants