1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-21 23:04:45 -05:00
denoland-deno/ext/web
Andreu Botella 1563088f06
fix: a Request whose URL is a revoked blob URL should still fetch (#11947)
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.
2021-09-08 11:29:21 +02:00
..
00_infra.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
01_dom_exception.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
01_mimesniff.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
02_event.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
02_structured_clone.js feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
03_abort_signal.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
04_global_interfaces.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
05_base64.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
06_streams.js feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
06_streams_types.d.ts Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
08_text_encoding.js feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
09_file.js fix: a Request whose URL is a revoked blob URL should still fetch (#11947) 2021-09-08 11:29:21 +02:00
10_filereader.js feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
11_blob_url.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
12_location.js Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00
13_message_port.js feat: ArrayBuffer in structured clone transfer (#11840) 2021-08-25 13:48:53 +02:00
blob.rs fix: a Request whose URL is a revoked blob URL should still fetch (#11947) 2021-09-08 11:29:21 +02:00
Cargo.toml chore: update dependencies (#11856) 2021-09-02 23:38:44 +02:00
internal.d.ts fix: a Request whose URL is a revoked blob URL should still fetch (#11947) 2021-09-08 11:29:21 +02:00
lib.deno_web.d.ts feat(fmt): add basic JS doc formatting (#11902) 2021-09-02 18:28:12 -04:00
lib.rs fix: a Request whose URL is a revoked blob URL should still fetch (#11947) 2021-09-08 11:29:21 +02:00
message_port.rs feat: ArrayBuffer in structured clone transfer (#11840) 2021-08-25 13:48:53 +02:00
README.md Rename extensions/ directory to ext/ (#11643) 2021-08-11 12:27:05 +02:00

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/.