godprotocol 2.2.91 → 2.2.93

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/Godprotocol.js CHANGED
@@ -7,11 +7,11 @@ class GodProtocol {
7
7
 
8
8
  this.static_path = config.static_path;
9
9
  this.api_key = config.api_key;
10
- this.platform_uri = this.domain_name(config.platform_uri);
10
+ this.platform_uri = this.uri_default_domain(config.platform_uri);
11
11
  this.route_table = new Route_table(this);
12
12
  }
13
13
 
14
- domain_name = (uri) => {
14
+ uri_default_domain = (uri) => {
15
15
  if (!uri.includes(".")) {
16
16
  uri = `${uri}.savvyaisolution.com`;
17
17
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "godprotocol",
3
- "version": "2.2.91",
3
+ "version": "2.2.93",
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",
@@ -107,10 +107,6 @@ const version_middleware = async (req, res, routers) => {
107
107
 
108
108
  let version;
109
109
 
110
- // Match:
111
- // /api/v1/...
112
- // /api/v2/...
113
- // /api/v3/...
114
110
  const versionMatch = pathname.match(/^\/api\/(v\d+)(\/|$)/i);
115
111
  if (req.method === "GET") {
116
112
  version = "__GET__";
@@ -120,6 +116,11 @@ const version_middleware = async (req, res, routers) => {
120
116
  version = req.headers["x-api-version"] || "v1";
121
117
  }
122
118
 
119
+ if (req.headers["x-platform"])
120
+ req.headers["x-platform"] = routers.gp.uri_default_domain(
121
+ req.headers["x-platform"],
122
+ );
123
+
123
124
  const versionRouter = await routers.get_version(version);
124
125
 
125
126
  if (!versionRouter) {