mirror of
https://github.com/denoland/deno.git
synced 2024-11-25 15:29:32 -05:00
1563088f06
In the spec, a URL record has an associated "blob URL entry", which for `blob:` URLs is populated during parsing to contain a reference to the `Blob` object that backs that object URL. It is this blob URL entry that the `fetch` API uses to resolve an object URL. Therefore, since the `Request` constructor parses URL inputs, it will have an associated blob URL entry which will be used when fetching, even if the object URL has been revoked since the construction of the `Request` object. (The `Request` constructor takes the URL as a string and parses it, so the object URL must be live at the time it is called.) This PR adds a new `blobFromObjectUrl` JS function (backed by a new `op_blob_from_object_url` op) that, if the URL is a valid object URL, returns a new `Blob` object whose parts are references to the same Rust `BlobPart`s used by the original `Blob` object. It uses this function to add a new `blobUrlEntry` field to inner requests, which will be `null` or such a `Blob`, and then uses `Blob.prototype.stream()` as the response's body. As a result of this, the `blob:` URL resolution from `op_fetch` is now useless, and has been removed. |
||
---|---|---|
.. | ||
00_infra.js | ||
01_dom_exception.js | ||
01_mimesniff.js | ||
02_event.js | ||
02_structured_clone.js | ||
03_abort_signal.js | ||
04_global_interfaces.js | ||
05_base64.js | ||
06_streams.js | ||
06_streams_types.d.ts | ||
08_text_encoding.js | ||
09_file.js | ||
10_filereader.js | ||
11_blob_url.js | ||
12_location.js | ||
13_message_port.js | ||
blob.rs | ||
Cargo.toml | ||
internal.d.ts | ||
lib.deno_web.d.ts | ||
lib.rs | ||
message_port.rs | ||
README.md |
deno web
Op crate that implements Event, TextEncoder, TextDecoder and File API (https://w3c.github.io/FileAPI).
Testing for text encoding is done via WPT in cli/.