mezon-js 2.14.18 → 2.14.19
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/mezon-js.cjs.js +1 -6
- package/dist/mezon-js.esm.mjs +1 -6
- package/package.json +1 -1
- package/utils.ts +2 -10
package/dist/mezon-js.cjs.js
CHANGED
|
@@ -31682,12 +31682,7 @@ function isSet2(value) {
|
|
|
31682
31682
|
function buildFetchOptions(method, options, bodyJson) {
|
|
31683
31683
|
const fetchOptions = __spreadValues(__spreadValues({}, { method }), options);
|
|
31684
31684
|
fetchOptions.headers = __spreadValues({}, options.headers);
|
|
31685
|
-
|
|
31686
|
-
const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "withCredentials");
|
|
31687
|
-
if (!(descriptor == null ? void 0 : descriptor.set)) {
|
|
31688
|
-
fetchOptions.credentials = "cocos-ignore";
|
|
31689
|
-
}
|
|
31690
|
-
}
|
|
31685
|
+
fetchOptions.headers["connect-protocol-version"] = "1";
|
|
31691
31686
|
if (!Object.keys(fetchOptions.headers).includes("Accept")) {
|
|
31692
31687
|
fetchOptions.headers["Accept"] = "application/proto";
|
|
31693
31688
|
}
|
package/dist/mezon-js.esm.mjs
CHANGED
|
@@ -31651,12 +31651,7 @@ function isSet2(value) {
|
|
|
31651
31651
|
function buildFetchOptions(method, options, bodyJson) {
|
|
31652
31652
|
const fetchOptions = __spreadValues(__spreadValues({}, { method }), options);
|
|
31653
31653
|
fetchOptions.headers = __spreadValues({}, options.headers);
|
|
31654
|
-
|
|
31655
|
-
const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "withCredentials");
|
|
31656
|
-
if (!(descriptor == null ? void 0 : descriptor.set)) {
|
|
31657
|
-
fetchOptions.credentials = "cocos-ignore";
|
|
31658
|
-
}
|
|
31659
|
-
}
|
|
31654
|
+
fetchOptions.headers["connect-protocol-version"] = "1";
|
|
31660
31655
|
if (!Object.keys(fetchOptions.headers).includes("Accept")) {
|
|
31661
31656
|
fetchOptions.headers["Accept"] = "application/proto";
|
|
31662
31657
|
}
|
package/package.json
CHANGED
package/utils.ts
CHANGED
|
@@ -5,15 +5,7 @@ export function buildFetchOptions(method: string, options: any, bodyJson: string
|
|
|
5
5
|
const fetchOptions = {...{ method: method }, ...options};
|
|
6
6
|
fetchOptions.headers = {...options.headers};
|
|
7
7
|
|
|
8
|
-
|
|
9
|
-
const descriptor = Object.getOwnPropertyDescriptor(XMLHttpRequest.prototype, "withCredentials");
|
|
10
|
-
|
|
11
|
-
// in Cocos Creator, XMLHttpRequest.withCredentials is not writable, so make the fetch
|
|
12
|
-
// polyfill avoid writing to it.
|
|
13
|
-
if (!descriptor?.set) {
|
|
14
|
-
fetchOptions.credentials = 'cocos-ignore'; // string value is arbitrary, cannot be 'omit' or 'include
|
|
15
|
-
}
|
|
16
|
-
}
|
|
8
|
+
fetchOptions.headers["connect-protocol-version"] = "1";
|
|
17
9
|
|
|
18
10
|
if(!Object.keys(fetchOptions.headers).includes("Accept")) {
|
|
19
11
|
fetchOptions.headers["Accept"] = "application/proto";
|
|
@@ -23,7 +15,7 @@ export function buildFetchOptions(method: string, options: any, bodyJson: string
|
|
|
23
15
|
fetchOptions.headers["Content-Type"] = "application/proto";
|
|
24
16
|
}
|
|
25
17
|
|
|
26
|
-
|
|
18
|
+
Object.keys(fetchOptions.headers).forEach((key: string) => {
|
|
27
19
|
if (!fetchOptions.headers[key]) {
|
|
28
20
|
delete fetchOptions.headers[key];
|
|
29
21
|
}
|