godprotocol 2.3.26 → 2.3.27

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": "godprotocol",
3
- "version": "2.3.26",
3
+ "version": "2.3.27",
4
4
  "description": "A distributed computing environment for Web 4.0 — integrating AI, decentralisation, and virtual computation.",
5
5
  "main": "Index.js",
6
6
  "type": "module",
@@ -81,9 +81,10 @@ class Services {
81
81
  let headers = {
82
82
  "Content-Type": "application/json",
83
83
  Accept: "application/json",
84
- "x-api-version": servic.local
85
- ? `${servic.local}:${header.api_version || servic.api_version}`
86
- : header.api_version || servic.api_version || "v1",
84
+ "x-api-version":
85
+ servic.local && !header.api_version.startsWith(`${servic.local}:`)
86
+ ? `${servic.local}:${header.api_version || servic.api_version}`
87
+ : header.api_version || servic.api_version || "v1",
87
88
  };
88
89
 
89
90
  if (header?.api_key) {
@@ -136,6 +137,13 @@ class Services {
136
137
 
137
138
  this.get_version(prev_version);
138
139
 
140
+ if (!reply?.ok) {
141
+ return {
142
+ ok: false,
143
+ message: `Response calling ${service} service at path ${path}`,
144
+ data: reply,
145
+ };
146
+ }
139
147
  return reply;
140
148
  } catch (e) {
141
149
  return {