@lwrjs/server 0.13.0-alpha.0 → 0.13.0-alpha.2

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.
@@ -98,7 +98,7 @@ var AbstractMiddlewareRequest = class {
98
98
  };
99
99
  let host = parseForwardedHeader(this.headers?.forwarded) || this.headers?.host || void 0;
100
100
  if (host && !host.startsWith("http")) {
101
- host = `${this.protocol}://${host}`;
101
+ host = `${this.headers?.["x-forwarded-proto"] || this.protocol}://${host}`;
102
102
  }
103
103
  const requestDepth = (0, import_shared_utils.parseRequestDepthHeader)(this.headers) + 1;
104
104
  const basePath = runtimeEnvironment.basePath;
@@ -72,7 +72,8 @@ export class AbstractMiddlewareRequest {
72
72
  };
73
73
  let host = parseForwardedHeader(this.headers?.forwarded) || this.headers?.host || undefined;
74
74
  if (host && !host.startsWith('http')) {
75
- host = `${this.protocol}://${host}`;
75
+ // If the Forwarded header did not set a protocol prefer X-Forwarded-Proto over the local server protocol
76
+ host = `${this.headers?.['x-forwarded-proto'] || this.protocol}://${host}`;
76
77
  }
77
78
  // Increment the depth for any fetch calls
78
79
  const requestDepth = parseRequestDepthHeader(this.headers) + 1;
package/package.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
7
- "version": "0.13.0-alpha.0",
7
+ "version": "0.13.0-alpha.2",
8
8
  "homepage": "https://developer.salesforce.com/docs/platform/lwr/overview",
9
9
  "repository": {
10
10
  "type": "git",
@@ -34,16 +34,16 @@
34
34
  "build/**/*.d.ts"
35
35
  ],
36
36
  "devDependencies": {
37
- "@lwrjs/types": "0.13.0-alpha.0",
38
- "@types/koa-compress": "^4.0.1",
37
+ "@lwrjs/types": "0.13.0-alpha.2",
38
+ "@types/koa-compress": "^4.0.6",
39
39
  "@types/koa__router": "^8.0.4",
40
40
  "jest-express": "^1.12.0"
41
41
  },
42
42
  "dependencies": {
43
43
  "@koa/router": "^10.0.0",
44
- "@lwrjs/diagnostics": "0.13.0-alpha.0",
45
- "@lwrjs/instrumentation": "0.13.0-alpha.0",
46
- "@lwrjs/shared-utils": "0.13.0-alpha.0",
44
+ "@lwrjs/diagnostics": "0.13.0-alpha.2",
45
+ "@lwrjs/instrumentation": "0.13.0-alpha.2",
46
+ "@lwrjs/shared-utils": "0.13.0-alpha.2",
47
47
  "@types/express": "^4.17.21",
48
48
  "@types/koa": "^2.15.0",
49
49
  "express": "^4.19.2",
@@ -53,5 +53,5 @@
53
53
  "engines": {
54
54
  "node": ">=18.0.0"
55
55
  },
56
- "gitHead": "c5fe8db55c74513dbb0937d1b4568109715a13fb"
56
+ "gitHead": "3ae1051ef1eb282f9c1fb54f6aab44ab5ba48480"
57
57
  }