godprotocol 2.3.26 → 2.3.28
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 +1 -1
- package/server/Routable/Services.js +11 -3
package/package.json
CHANGED
|
@@ -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":
|
|
85
|
-
|
|
86
|
-
|
|
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 (typeof reply?.ok !== "boolean") {
|
|
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 {
|