cozy-client 41.2.0 → 41.2.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/dist/CozyClient.js +10 -2
- package/dist/CozyClient.spec.js +1 -1
- package/package.json +2 -2
package/dist/CozyClient.js
CHANGED
|
@@ -115,13 +115,21 @@ var referencesUnsupportedError = function referencesUnsupportedError(relationshi
|
|
|
115
115
|
return new Error("The \"".concat(relationshipClassName, "\" relationship does not support references. If you need to add references to a document, its relationship class must have the methods {add,remove}References"));
|
|
116
116
|
};
|
|
117
117
|
|
|
118
|
+
var removeTrailingSlash = function removeTrailingSlash(str) {
|
|
119
|
+
if (str.endsWith('/')) {
|
|
120
|
+
return str.slice(0, -1);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
return str;
|
|
124
|
+
};
|
|
125
|
+
|
|
118
126
|
var securiseUri = function securiseUri(uri) {
|
|
119
127
|
var _window$cozy;
|
|
120
128
|
|
|
121
129
|
if (uri && typeof window !== 'undefined' && (_window$cozy = window['cozy']) !== null && _window$cozy !== void 0 && _window$cozy.isSecureProtocol) {
|
|
122
130
|
var secureUrl = new URL(uri);
|
|
123
131
|
secureUrl.protocol = 'https:';
|
|
124
|
-
return secureUrl.toString();
|
|
132
|
+
return removeTrailingSlash(secureUrl.toString());
|
|
125
133
|
}
|
|
126
134
|
|
|
127
135
|
return uri;
|
|
@@ -2695,7 +2703,7 @@ var CozyClient = /*#__PURE__*/function () {
|
|
|
2695
2703
|
CozyClient.hooks = CozyClient.hooks || {};
|
|
2696
2704
|
CozyClient.fetchPolicies = _policies.default; //COZY_CLIENT_VERSION_PACKAGE in replaced by babel. See babel config
|
|
2697
2705
|
|
|
2698
|
-
CozyClient.version = "41.2.
|
|
2706
|
+
CozyClient.version = "41.2.1";
|
|
2699
2707
|
|
|
2700
2708
|
_microee.default.mixin(CozyClient);
|
|
2701
2709
|
|
package/dist/CozyClient.spec.js
CHANGED
|
@@ -263,7 +263,7 @@ describe('CozyClient initialization', () => {
|
|
|
263
263
|
token: 'SOME_TOKEN'
|
|
264
264
|
})
|
|
265
265
|
|
|
266
|
-
expect(client.options.uri).toBe('https://cozy.tools
|
|
266
|
+
expect(client.options.uri).toBe('https://cozy.tools')
|
|
267
267
|
})
|
|
268
268
|
|
|
269
269
|
it('should NOT secure the URL if window.cozy.isSecureProtocol is false', () => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cozy-client",
|
|
3
|
-
"version": "41.2.
|
|
3
|
+
"version": "41.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"main": "dist/index.node.js",
|
|
6
6
|
"browser": "dist/index.js",
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"react-native-ios11-devicecheck": "https://github.com/cozy/react-native-devicecheck#app-attest-v0.1"
|
|
76
76
|
},
|
|
77
77
|
"sideEffects": false,
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "f637f8b66229a89f5bc41bc4b9ccf8e96345f7c0"
|
|
79
79
|
}
|