@tauri-apps/plugin-http 2.2.0 → 2.3.0
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/dist-js/index.cjs +4 -1
- package/dist-js/index.d.ts +19 -0
- package/dist-js/index.js +4 -1
- package/package.json +1 -1
package/dist-js/index.cjs
CHANGED
|
@@ -52,11 +52,13 @@ async function fetch(input, init) {
|
|
|
52
52
|
const maxRedirections = init?.maxRedirections;
|
|
53
53
|
const connectTimeout = init?.connectTimeout;
|
|
54
54
|
const proxy = init?.proxy;
|
|
55
|
+
const danger = init?.danger;
|
|
55
56
|
// Remove these fields before creating the request
|
|
56
57
|
if (init) {
|
|
57
58
|
delete init.maxRedirections;
|
|
58
59
|
delete init.connectTimeout;
|
|
59
60
|
delete init.proxy;
|
|
61
|
+
delete init.danger;
|
|
60
62
|
}
|
|
61
63
|
const headers = init?.headers
|
|
62
64
|
? init.headers instanceof Headers
|
|
@@ -97,7 +99,8 @@ async function fetch(input, init) {
|
|
|
97
99
|
data,
|
|
98
100
|
maxRedirections,
|
|
99
101
|
connectTimeout,
|
|
100
|
-
proxy
|
|
102
|
+
proxy,
|
|
103
|
+
danger
|
|
101
104
|
}
|
|
102
105
|
});
|
|
103
106
|
const abort = () => core.invoke('plugin:http|fetch_cancel', { rid });
|
package/dist-js/index.d.ts
CHANGED
|
@@ -52,6 +52,25 @@ export interface ClientOptions {
|
|
|
52
52
|
* Configuration of a proxy that a Client should pass requests to.
|
|
53
53
|
*/
|
|
54
54
|
proxy?: Proxy;
|
|
55
|
+
/**
|
|
56
|
+
* Configuration for dangerous settings on the client such as disabling SSL verification.
|
|
57
|
+
*/
|
|
58
|
+
danger?: DangerousSettings;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Configuration for dangerous settings on the client such as disabling SSL verification.
|
|
62
|
+
*
|
|
63
|
+
* @since 2.3.0
|
|
64
|
+
*/
|
|
65
|
+
export interface DangerousSettings {
|
|
66
|
+
/**
|
|
67
|
+
* Disables SSL verification.
|
|
68
|
+
*/
|
|
69
|
+
acceptInvalidCerts?: boolean;
|
|
70
|
+
/**
|
|
71
|
+
* Disables hostname verification.
|
|
72
|
+
*/
|
|
73
|
+
acceptInvalidHostnames?: boolean;
|
|
55
74
|
}
|
|
56
75
|
/**
|
|
57
76
|
* Fetch a resource from the network. It returns a `Promise` that resolves to the
|
package/dist-js/index.js
CHANGED
|
@@ -50,11 +50,13 @@ async function fetch(input, init) {
|
|
|
50
50
|
const maxRedirections = init?.maxRedirections;
|
|
51
51
|
const connectTimeout = init?.connectTimeout;
|
|
52
52
|
const proxy = init?.proxy;
|
|
53
|
+
const danger = init?.danger;
|
|
53
54
|
// Remove these fields before creating the request
|
|
54
55
|
if (init) {
|
|
55
56
|
delete init.maxRedirections;
|
|
56
57
|
delete init.connectTimeout;
|
|
57
58
|
delete init.proxy;
|
|
59
|
+
delete init.danger;
|
|
58
60
|
}
|
|
59
61
|
const headers = init?.headers
|
|
60
62
|
? init.headers instanceof Headers
|
|
@@ -95,7 +97,8 @@ async function fetch(input, init) {
|
|
|
95
97
|
data,
|
|
96
98
|
maxRedirections,
|
|
97
99
|
connectTimeout,
|
|
98
|
-
proxy
|
|
100
|
+
proxy,
|
|
101
|
+
danger
|
|
99
102
|
}
|
|
100
103
|
});
|
|
101
104
|
const abort = () => invoke('plugin:http|fetch_cancel', { rid });
|