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(ext/fetch): support fetching local files #12545

Merged
merged 9 commits into from
Nov 1, 2021

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Oct 26, 2021

Closes #11925
Closes #2150

ext/fetch/lib.rs Outdated Show resolved Hide resolved
ext/fetch/lib.rs Outdated Show resolved Hide resolved
@kitsonk kitsonk force-pushed the kitsonk/issue11925 branch from e1eb831 to bca32cb Compare October 29, 2021 03:47
Copy link
Member

@lucacasonato lucacasonato left a comment

Choose a reason for hiding this comment

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

Just some minor comments.

ext/fetch/fs_fetch_handler.rs Outdated Show resolved Hide resolved
ext/fetch/lib.rs Outdated Show resolved Hide resolved
ext/fetch/fs_fetch_handler.rs Outdated Show resolved Hide resolved
@kitsonk kitsonk force-pushed the kitsonk/issue11925 branch from 7746a4b to 43207a1 Compare November 1, 2021 03:36
@kitsonk kitsonk merged commit d3662e4 into denoland:main Nov 1, 2021
@kitsonk kitsonk deleted the kitsonk/issue11925 branch November 1, 2021 04:29
andreubotella pushed a commit to andreubotella/deno that referenced this pull request Nov 26, 2021
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.
kitsonk pushed a commit that referenced this pull request Nov 26, 2021
…fetches (#12901)

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.
This was referenced Aug 14, 2023
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.

Proposal: Local File Fetch fetch() a local file
4 participants