From 4c41ba5ad787909a478a6ef0d4e36adc05b52b9d Mon Sep 17 00:00:00 2001 From: Kid <44045911+kidonng@users.noreply.github.com> Date: Mon, 26 Oct 2020 22:02:08 +0800 Subject: fix(op_crates/fetch): ensure Request.method to be string (#8100) Ensure "Request.method" to be the default value ("GET") if "init.method" is not defined, which follows browser's behavior. --- op_crates/fetch/26_fetch.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'op_crates/fetch/26_fetch.js') diff --git a/op_crates/fetch/26_fetch.js b/op_crates/fetch/26_fetch.js index 887e329f9..c8b2c8794 100644 --- a/op_crates/fetch/26_fetch.js +++ b/op_crates/fetch/26_fetch.js @@ -990,7 +990,7 @@ this.url = new URL(String(input)).href; } - if (init && "method" in init) { + if (init && "method" in init && init.method) { this.method = normalizeMethod(init.method); } -- cgit v1.2.3