@open-mercato/shared 0.7.1-develop.7111.1.c0d5d7286f → 0.7.1-develop.7113.1.9d83dca10c

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.
@@ -1,4 +1,4 @@
1
- const APP_VERSION = "0.7.1-develop.7111.1.c0d5d7286f";
1
+ const APP_VERSION = "0.7.1-develop.7113.1.9d83dca10c";
2
2
  const appVersion = APP_VERSION;
3
3
  export {
4
4
  APP_VERSION,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/lib/version.ts"],
4
- "sourcesContent": ["// Build-time generated version\nexport const APP_VERSION = '0.7.1-develop.7111.1.c0d5d7286f';\nexport const appVersion = APP_VERSION;\n"],
4
+ "sourcesContent": ["// Build-time generated version\nexport const APP_VERSION = '0.7.1-develop.7113.1.9d83dca10c';\nexport const appVersion = APP_VERSION;\n"],
5
5
  "mappings": "AACO,MAAM,cAAc;AACpB,MAAM,aAAa;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-mercato/shared",
3
- "version": "0.7.1-develop.7111.1.c0d5d7286f",
3
+ "version": "0.7.1-develop.7113.1.9d83dca10c",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -109,7 +109,7 @@
109
109
  "@mikro-orm/core": "^7.1.8",
110
110
  "@mikro-orm/decorators": "^7.1.8",
111
111
  "@mikro-orm/postgresql": "^7.1.8",
112
- "@open-mercato/cache": "0.7.1-develop.7111.1.c0d5d7286f",
112
+ "@open-mercato/cache": "0.7.1-develop.7113.1.9d83dca10c",
113
113
  "@types/html-to-text": "^9.0.4",
114
114
  "@types/sanitize-html": "^2.16.1",
115
115
  "dotenv": "^17.4.2",
@@ -89,6 +89,23 @@ describe('security email URL helpers', () => {
89
89
  expect(() => assertAllowedAppOrigin(request, env)).not.toThrow()
90
90
  })
91
91
 
92
+ test('cannot see forwarded headers when the request is passed as a URL string', () => {
93
+ const env = {
94
+ APP_URL: 'https://app.example.com',
95
+ NODE_ENV: 'production',
96
+ }
97
+ const request = new Request('https://localhost:6789/api/auth/users/resend-invite', {
98
+ headers: {
99
+ host: 'app.example.com',
100
+ 'x-forwarded-host': 'app.example.com',
101
+ 'x-forwarded-proto': 'https',
102
+ },
103
+ })
104
+
105
+ expect(() => assertAllowedAppOrigin(request, env)).not.toThrow()
106
+ expect(() => assertAllowedAppOrigin(request.url, env)).toThrow(AppOriginRejectedError)
107
+ })
108
+
92
109
  test('allows loopback origin mismatches outside production', () => {
93
110
  const env = {
94
111
  APP_URL: 'http://localhost:3000',