Skip to content

Commit 2cb0fa7

Browse files
i-c-bBricklou
andauthored
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>
1 parent 319de69 commit 2cb0fa7

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"http": patch
3+
---
4+
5+
Remove `cmd` property which breaks invoke call.

plugins/http/guest-js/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ export async function fetch(
7777
const reqData = buffer.byteLength ? Array.from(new Uint8Array(buffer)) : null;
7878

7979
const rid = await window.__TAURI_INVOKE__<number>("plugin:http|fetch", {
80-
cmd: "fetch",
8180
method: req.method,
8281
url: req.url,
8382
headers: Array.from(req.headers.entries()),
@@ -111,7 +110,7 @@ export async function fetch(
111110
},
112111
);
113112

114-
const res = new Response(Uint8Array.from(body), {
113+
const res = new Response(new Uint8Array(body), {
115114
headers,
116115
status,
117116
statusText,

plugins/http/src/api-iife.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)