fix(http): remove cmd property from http|fetch invoke, closes #587 (#588)

* Remove `cmd` property from `http|fetch` invoke

* Build generated JS file

* Create http-remove-cmd-property.md

* Fix incompatible declaration for reading body

Co-authored-by: Louis Bailleau <Bricklou@users.noreply.github.com>

* Build generated JS file

Co-authored-by: Louis Bailleau <Bricklou@users.noreply.github.com>

---------

Co-authored-by: Louis Bailleau <Bricklou@users.noreply.github.com>
This commit is contained in:
i-c-b
2023-09-04 22:45:41 +10:00
committed by GitHub
parent 319de692bf
commit 2cb0fa719b
3 changed files with 7 additions and 3 deletions
+1 -2
View File
@@ -77,7 +77,6 @@ export async function fetch(
const reqData = buffer.byteLength ? Array.from(new Uint8Array(buffer)) : null;
const rid = await window.__TAURI_INVOKE__<number>("plugin:http|fetch", {
cmd: "fetch",
method: req.method,
url: req.url,
headers: Array.from(req.headers.entries()),
@@ -111,7 +110,7 @@ export async function fetch(
},
);
const res = new Response(Uint8Array.from(body), {
const res = new Response(new Uint8Array(body), {
headers,
status,
statusText,