summaryrefslogtreecommitdiff
path: root/ext/fetch
AgeCommit message (Collapse)Author
2021-10-29fix(ext/fetch): Replace redundant local variable with inline return ↵Malted
statement (#12583)
2021-10-26perf(http): encode string bodies in op-layer (#12451)Aaron O'Mullan
Using serde_v8's StringOrBuffer
2021-10-25chore: bump crate version for 1.15.3 (#12531)Yoshiya Hinosawa
2021-10-21fix: declare web types as global (#12497)Bartek Iwańczuk
Co-authored-by: Feng Yu <F3n67u@outlook.com>
2021-10-18chore: release crates for v1.15.2 (#12478)Bartek Iwańczuk
2021-10-12chore: bump crate version for 1.15.0 (#12406)Satya Rohith
2021-10-12chore: upgrade crates based on deno ast 0.3 (#12403)David Sherret
2021-10-11perf(webidl): inline ResponseInit converter (#12285)Aaron O'Mullan
2021-10-10feat: Show the URL of streaming WASM modules in stack traces (#12268)Andreu Botella
WebAssembly modules compiled through `WebAssembly.compile()` and similar non-streaming APIs don't have a URL associated to them, because they have been compiled from a buffer source. In stack traces, V8 will use a URL such as `wasm://wasm/d1c677ea`, with a hash of the module. However, wasm modules compiled through streaming APIs, like `WebAssembly.compileStreaming()`, do have a known URL, which can be obtained from the `Response` object passed into the streaming APIs. And as per the developer-facing display conventions in the WebAssembly Web API spec, this URL should be used in stack traces. This change implements that.
2021-10-07perf(fetch): fast path Uint8Array in extractBody() (#12351)Aaron O'Mullan
2021-10-05chore: various op cleanup (#12329)Leo K
2021-10-05chore: merge v1.14.3 into main (#12327)Bartek Iwańczuk
2021-10-04chore: remove No*Permissions structs (#12316)Luca Casonato
These are confusing. They say they are "for users that don't care about permissions", but that isn't correct. `NoTimersPermissions` disables permissions instead of enabling them. I would argue that implementors should decide what permissions they want themselves, and not take our opinionated permissions struct.
2021-10-01perf(fetch): optimize fillHeaders() key iteration (#12287)Aaron O'Mullan
Reduces self-time by ~70x (~70ms => ~1ms on 1M iters) for...in filtered by hasOwnProperty yields the same set of keys as Object.keys()
2021-09-30perf(web): ~400x faster http header trimming (#12277)Aaron O'Mullan
Use a regex substring match with a first/last char fastpath instead of 2 regex replaces. Roughly ~400x faster (423ms vs 0.7ms in profiled runs)
2021-09-30feat(tls): custom in memory CA certificates (#12219)Luca Casonato
This adds support for using in memory CA certificates for `Deno.startTLS`, `Deno.connectTLS` and `Deno.createHttpClient`. `certFile` is deprecated in `startTls` and `connectTls`, and removed from `Deno.createHttpClient`.
2021-09-29fix(ext/fetch): avoid panic when header is invalid (#12244)Ahab
2021-09-28chore: bump crate versions for 1.14.2 (#12253)Aaron O'Mullan
2021-09-27perf(fetch): optimize newInnerRequest blob url check (#12245)Aaron O'Mullan
Avoid "blob:" prefix check on requests built in the http module since those can never be blob objects Reduces cost of `newInnerRequest()` from 20ms to 0.1ms in my profiled run on ~2.5M reqs
2021-09-27refactor(fetch/Request): inline defaultInnerRequest (#12241)Aaron O'Mullan
Similar to #12235
2021-09-27perf(fetch/Response): avoid class fields (#12237)Aaron O'Mullan
2021-09-26refactor(fetch/response): inline defaultInnerResponse (#12235)Aaron O'Mullan
Not useful to have the defaults externally defined when they're only used in `newInnerResponse()`. Also match order in `newInnerResponse()` and `cloneInnerResponse`
2021-09-26perf(fetch): optimize InnerBody constructor (#12232)Aaron O'Mullan
Avoid initializers due to overhead
2021-09-26perf(fetch/headers): optimize appendHeader (#12234)Aaron O'Mullan
Use a single regex to check for `\0`, `\n`, `\r` instead of 3 `String.includes(...)` calls
2021-09-25perf(ext/fetch): Use the WebIDL conversion to DOMString rather than ↵Luis Malheiro
USVString for Response constructor (#12201)
2021-09-25fix(ext/webidl): correctly apply [SymbolToStringTag] to interfaces (#11851)李瑞丰
Co-authored-by: Luca Casonato <hello@lcas.dev> Co-authored-by: Yoshiya Hinosawa <stibium121@gmail.com>
2021-09-23perf(ext/fetch): skip USVString webidl conv on string constructor (#12168)Aaron O'Mullan
* perf(ext/fetch): skip USVString webidl conv on string constructor * Rename webidl convert to RequestInfo_DOMString To disambiguate and hint that it normalizes to DOMString instead of USVString since DOMString => USVString is handled by `op_url_parse` when calling `new URL(...)`
2021-09-22chore: bump crate versions for 1.14.1 (#12172)Kitson Kelly
2021-09-21cleanup(ext/fetch): drop redundant webidl converters in fetch() (#12167)Aaron O'Mullan
Since those inputs are passed to `new Request(...)` which applies webidl converters
2021-09-17chore: Remove unused deps from Cargo.toml files (#12106)Squirrel
2021-09-14chore: bump crate versions for 0.14 (#12072)David Sherret
2021-09-13refactor(core): Turn the `wasm_streaming_feed` binding into ops (#11985)Andreu Botella
Async WebAssembly compilation was implemented by adding two bindings: `set_wasm_streaming_callback`, which registered a callback to be called whenever a streaming wasm compilation was started, and `wasm_streaming_feed`, which let the JS callback modify the state of the v8 wasm compiler. `set_wasm_streaming_callback` cannot currently be implemented as anything other than a binding, but `wasm_streaming_feed` does not really need to use anything specific to bindings, and could indeed be implemented as one or more ops. This PR does that, resulting in a simplification of the relevant code. There are three operations on the state of the v8 wasm compiler that `wasm_streaming_feed` allowed: feeding new bytes into the compiler, letting it know that there are no more bytes coming from the network, and aborting the compilation. This PR provides `op_wasm_streaming_feed` to feed new bytes into the compiler, and `op_wasm_streaming_abort` to abort the compilation. It doesn't provide an op to let v8 know that the response is finished, but closing the resource with `Deno.core.close()` will achieve that.
2021-09-13fix(ext/fetch): Properly cancel upload stream when aborting (#11966)Nayeem Rahman
Co-authored-by: Luca Casonato <lucacasonato@yahoo.com>
2021-09-11refactor: use Deno.core.tryClose (#11980)Bartek Iwańczuk
2021-09-08fix: a `Request` whose URL is a revoked blob URL should still fetch (#11947)Andreu Botella
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-02chore: update dependencies (#11856)Luca Casonato
Co-authored-by: Bartek Iwańczuk <biwanczuk@gmail.com>
2021-08-25feat(fetch): mTLS client certificates for fetch() (#11721)Sean Michael Wykes
This commit adds support for specifying client certificates when using fetch, by means of `Deno.createHttpClient`.
2021-08-23chore: release crates for 1.13.2 (#11820)David Sherret
2021-08-21fiz(ext/fetch): Headers constructor error message (#11778)Feng Yu
2021-08-16chore: release crates for 1.13.1 (#11729)David Sherret
2021-08-16fix(ext/fetch): better error if no content-typeBen Noordhuis
The streaming WASM support code inspects the Response object's Content-Type header but if that was missing, it failed with a fairly inscrutable "String.prototype.toLowerCase called on null or undefined" exception. Now it raises a more legible "Invalid WebAssembly content type" exception.
2021-08-16fix(ext/fetch): don't use global Deno objectBen Noordhuis
Don't use `Deno.core`, it's not present in embedders that don't expose the Deno global object.
2021-08-16feat(runtime): support classic workers for internal testing (#11338)Andreu Botella
This commit implements classic workers, but only when the `--enable-testing-features-do-not-use` flag is provided. This change is not user facing. Classic workers are used extensively in WPT tests. The classic workers do not support loading from disk, and do not support TypeScript. Co-authored-by: Luca Casonato <hello@lcas.dev>
2021-08-15refactor(ops): return BadResource errors in ResourceTable calls (#11710)Aaron O'Mullan
* refactor(ops): return BadResource errors in ResourceTable calls Instead of relying on callers to map Options to Results via `.ok_or_else(bad_resource_id)` at over 176 different call sites ...
2021-08-11Rename extensions/ directory to ext/ (#11643)Ryan Dahl