@verii/http-client 1.1.0-pre.1762297666 → 1.1.0-pre.1762411615
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/package.json +2 -2
- package/src/client.js +3 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@verii/http-client",
|
|
3
|
-
"version": "1.1.0-pre.
|
|
3
|
+
"version": "1.1.0-pre.1762411615",
|
|
4
4
|
"description": "HTTP client for Verii network",
|
|
5
5
|
"repository": "https://github.com/LFDT-Verii/core",
|
|
6
6
|
"main": "index.js",
|
|
@@ -42,5 +42,5 @@
|
|
|
42
42
|
"lib"
|
|
43
43
|
]
|
|
44
44
|
},
|
|
45
|
-
"gitHead": "
|
|
45
|
+
"gitHead": "17ec78f18fc30282fe1de5579edde0f7598ebb5f"
|
|
46
46
|
}
|
package/src/client.js
CHANGED
|
@@ -23,6 +23,7 @@ const {
|
|
|
23
23
|
} = require('undici');
|
|
24
24
|
const { createOidcInterceptor } = require('undici-oidc-interceptor');
|
|
25
25
|
const { map } = require('lodash/fp');
|
|
26
|
+
const { isObject } = require('lodash');
|
|
26
27
|
const pkg = require('../package.json');
|
|
27
28
|
|
|
28
29
|
const USER_AGENT_HEADER = `${pkg.name}/${pkg.version}`;
|
|
@@ -54,7 +55,7 @@ const buildInterceptors = ({
|
|
|
54
55
|
clientId,
|
|
55
56
|
clientSecret,
|
|
56
57
|
retryOnStatusCodes: [401],
|
|
57
|
-
scopes,
|
|
58
|
+
scope: scopes,
|
|
58
59
|
audience,
|
|
59
60
|
urls: origins,
|
|
60
61
|
});
|
|
@@ -178,7 +179,7 @@ const initHttpClient = (options) => {
|
|
|
178
179
|
HTTP_VERBS.POST,
|
|
179
180
|
host,
|
|
180
181
|
context,
|
|
181
|
-
JSON.stringify(payload)
|
|
182
|
+
isObject(payload) ? JSON.stringify(payload) : payload
|
|
182
183
|
),
|
|
183
184
|
delete: (url, reqOptions) =>
|
|
184
185
|
request(url, reqOptions, HTTP_VERBS.DELETE, host, context),
|