@tauri-apps/plugin-http 2.0.0-beta.0 → 2.0.0-beta.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -4,7 +4,7 @@ Access the HTTP client written in Rust.
4
4
 
5
5
  ## Install
6
6
 
7
- _This plugin requires a Rust version of at least **1.70**_
7
+ _This plugin requires a Rust version of at least **1.75**_
8
8
 
9
9
  There are three general methods of installation that we can recommend.
10
10
 
package/dist-js/index.cjs CHANGED
@@ -76,7 +76,11 @@ async function fetch(input, init) {
76
76
  const body = await core.invoke("plugin:http|fetch_read_body", {
77
77
  rid: responseRid,
78
78
  });
79
- const res = new Response(new Uint8Array(body), {
79
+ const res = new Response(body instanceof ArrayBuffer && body.byteLength
80
+ ? body
81
+ : body instanceof Array && body.length
82
+ ? new Uint8Array(body)
83
+ : null, {
80
84
  headers,
81
85
  status,
82
86
  statusText,
package/dist-js/index.js CHANGED
@@ -74,7 +74,11 @@ async function fetch(input, init) {
74
74
  const body = await invoke("plugin:http|fetch_read_body", {
75
75
  rid: responseRid,
76
76
  });
77
- const res = new Response(new Uint8Array(body), {
77
+ const res = new Response(body instanceof ArrayBuffer && body.byteLength
78
+ ? body
79
+ : body instanceof Array && body.length
80
+ ? new Uint8Array(body)
81
+ : null, {
78
82
  headers,
79
83
  status,
80
84
  statusText,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tauri-apps/plugin-http",
3
- "version": "2.0.0-beta.0",
3
+ "version": "2.0.0-beta.1",
4
4
  "license": "MIT or APACHE-2.0",
5
5
  "authors": [
6
6
  "Tauri Programme within The Commons Conservancy"
@@ -20,7 +20,7 @@
20
20
  "LICENSE"
21
21
  ],
22
22
  "dependencies": {
23
- "@tauri-apps/api": "2.0.0-beta.0"
23
+ "@tauri-apps/api": "2.0.0-beta.2"
24
24
  },
25
25
  "scripts": {
26
26
  "build": "rollup -c"