ywana-core8 0.0.372 → 0.0.375

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ywana-core8",
3
- "version": "0.0.372",
3
+ "version": "0.0.375",
4
4
  "description": "ywana-core8",
5
5
  "author": "Ernesto Roldan Garcia",
6
6
  "license": "MIT",
@@ -2,18 +2,24 @@ async function fetchAsync(method, URL, body = null, token, headers) {
2
2
 
3
3
  console.log('FETCH', method, URL)
4
4
 
5
+
6
+ const requestHeaders = Object.assign({}, {
7
+ "Accept": "application/json",
8
+ "Content-Type": "application/json",
9
+ "x-access-token": token
10
+ }, headers)
11
+
5
12
  const request = {
6
13
  method,
7
14
  mode: 'cors',
8
- headers: {
9
- "Accept": "application/json",
10
- "Content-Type": "application/json",
11
- "x-access-token": token,
12
- ...headers
13
- },
15
+ headers: requestHeaders,
14
16
  body
15
17
  }
16
18
 
19
+ console.log("HTTP Client", request)
20
+
21
+ if (headers) request.headers = request.headers
22
+
17
23
  try {
18
24
  var response = await fetch(URL, request);
19
25
  if (response.ok) {