From 9e6cd91014ac4a0d34556b0d09cbe25e4e0930c6 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Tue, 20 Apr 2021 14:47:22 +0200 Subject: chore: align fetch to spec (#10203) This commit aligns the `fetch` API and the `Request` / `Response` classes belonging to it to the spec. This commit enables all the relevant `fetch` WPT tests. Spec compliance is now at around 90%. Performance is essentially identical now (within 1% of 1.9.0). --- op_crates/url/00_url.js | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'op_crates/url/00_url.js') diff --git a/op_crates/url/00_url.js b/op_crates/url/00_url.js index 7c24a871a..f51b4aedc 100644 --- a/op_crates/url/00_url.js +++ b/op_crates/url/00_url.js @@ -391,8 +391,19 @@ } } + /** + * This function implements application/x-www-form-urlencoded parsing. + * https://url.spec.whatwg.org/#concept-urlencoded-parser + * @param {Uint8Array} bytes + * @returns {[string, string][]} + */ + function parseUrlEncoded(bytes) { + return core.opSync("op_url_parse_search_params", null, bytes); + } + window.__bootstrap.url = { URL, URLSearchParams, + parseUrlEncoded, }; })(this); -- cgit v1.2.3