@flamingo-stack/openframe-frontend-core 0.0.645-2219.6362.1 → 0.0.645
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/dist/{chunk-KHHFMHYE.cjs → chunk-3J7YNAYI.cjs} +3 -3
- package/dist/chunk-3J7YNAYI.cjs.map +1 -0
- package/dist/{chunk-HQBC7YRF.js → chunk-3PGYHT67.js} +2 -2
- package/dist/{chunk-O2SLSYJC.cjs → chunk-46G4WFA7.cjs} +4 -4
- package/dist/{chunk-O2SLSYJC.cjs.map → chunk-46G4WFA7.cjs.map} +1 -1
- package/dist/{chunk-K72YMLCU.cjs → chunk-4A4DQSTI.cjs} +25 -25
- package/dist/{chunk-K72YMLCU.cjs.map → chunk-4A4DQSTI.cjs.map} +1 -1
- package/dist/{chunk-3WLHNR2G.cjs → chunk-56FDKQ7R.cjs} +33 -33
- package/dist/{chunk-3WLHNR2G.cjs.map → chunk-56FDKQ7R.cjs.map} +1 -1
- package/dist/{chunk-OBBAT4AU.js → chunk-6PMUA6JW.js} +3 -3
- package/dist/{chunk-WWPANZTL.js → chunk-EI3SLIWL.js} +3 -3
- package/dist/{chunk-O3YNMOIS.cjs → chunk-GPZ6Q2NP.cjs} +15 -15
- package/dist/{chunk-O3YNMOIS.cjs.map → chunk-GPZ6Q2NP.cjs.map} +1 -1
- package/dist/{chunk-N7IAE3DN.js → chunk-GSNX2GDA.js} +4 -4
- package/dist/{chunk-EDNZ2HN3.js → chunk-HDCIDJSP.js} +6 -6
- package/dist/{chunk-UF5VXOVZ.js → chunk-HHE7UNGR.js} +5 -5
- package/dist/{chunk-CYXV5HPV.js → chunk-JZVSQT2V.js} +3 -3
- package/dist/{chunk-EBDCDHOT.js → chunk-KYIOOOQY.js} +2 -2
- package/dist/{chunk-ZC7BVCDJ.cjs → chunk-M2MTAES4.cjs} +45 -45
- package/dist/{chunk-ZC7BVCDJ.cjs.map → chunk-M2MTAES4.cjs.map} +1 -1
- package/dist/{chunk-EADBLRNF.js → chunk-MTC6DWVH.js} +2 -2
- package/dist/{chunk-TIYVK2BE.cjs → chunk-N4Q5GKBN.cjs} +10 -10
- package/dist/{chunk-TIYVK2BE.cjs.map → chunk-N4Q5GKBN.cjs.map} +1 -1
- package/dist/{chunk-4GZZYHG5.cjs → chunk-OGBM3JPR.cjs} +71 -71
- package/dist/{chunk-4GZZYHG5.cjs.map → chunk-OGBM3JPR.cjs.map} +1 -1
- package/dist/{chunk-BWGV4TI5.cjs → chunk-Q7XUKTBB.cjs} +5 -5
- package/dist/{chunk-BWGV4TI5.cjs.map → chunk-Q7XUKTBB.cjs.map} +1 -1
- package/dist/{chunk-5F5WKIDW.cjs → chunk-QXML4X4W.cjs} +9 -9
- package/dist/{chunk-5F5WKIDW.cjs.map → chunk-QXML4X4W.cjs.map} +1 -1
- package/dist/{chunk-O7LA444D.js → chunk-R3CH2ASE.js} +2 -2
- package/dist/{chunk-QP7Z4EN7.js → chunk-RUC2V3VH.js} +3 -3
- package/dist/{chunk-BH34E2RJ.cjs → chunk-SID5YPKF.cjs} +22 -22
- package/dist/{chunk-BH34E2RJ.cjs.map → chunk-SID5YPKF.cjs.map} +1 -1
- package/dist/{chunk-REDPQ7F6.js → chunk-T36DLNMO.js} +2 -2
- package/dist/{chunk-OPNEE5XD.cjs → chunk-UF7AUQ3M.cjs} +22 -22
- package/dist/{chunk-OPNEE5XD.cjs.map → chunk-UF7AUQ3M.cjs.map} +1 -1
- package/dist/{chunk-2SNL36JV.js → chunk-ULJNU46H.js} +3 -3
- package/dist/{chunk-AHC2CQDD.cjs → chunk-WIYSHSNU.cjs} +10 -10
- package/dist/{chunk-AHC2CQDD.cjs.map → chunk-WIYSHSNU.cjs.map} +1 -1
- package/dist/{chunk-DEIYPXGD.js → chunk-WSRGTWQL.js} +5 -5
- package/dist/{chunk-CLVJC6SI.js → chunk-X7LGHPH5.js} +3 -3
- package/dist/{chunk-CLVJC6SI.js.map → chunk-X7LGHPH5.js.map} +1 -1
- package/dist/{chunk-WDFDZSAK.cjs → chunk-XILTWY3L.cjs} +163 -163
- package/dist/{chunk-WDFDZSAK.cjs.map → chunk-XILTWY3L.cjs.map} +1 -1
- package/dist/{chunk-KL3Z26IS.cjs → chunk-YEXV52L5.cjs} +3 -3
- package/dist/{chunk-KL3Z26IS.cjs.map → chunk-YEXV52L5.cjs.map} +1 -1
- package/dist/{chunk-UOOA73XL.cjs → chunk-YQZXCJQL.cjs} +3 -3
- package/dist/{chunk-UOOA73XL.cjs.map → chunk-YQZXCJQL.cjs.map} +1 -1
- package/dist/{chunk-IERXOVIS.js → chunk-Z7UIO5RQ.js} +5 -5
- package/dist/components/case-studies/index.cjs +14 -14
- package/dist/components/case-studies/index.js +3 -3
- package/dist/components/chat/index.cjs +2 -2
- package/dist/components/chat/index.js +1 -1
- package/dist/components/contact/index.cjs +4 -4
- package/dist/components/contact/index.js +3 -3
- package/dist/components/docs/index.cjs +7 -7
- package/dist/components/docs/index.js +6 -6
- package/dist/components/embeds/index.cjs +4 -4
- package/dist/components/embeds/index.js +3 -3
- package/dist/components/faq/index.cjs +4 -4
- package/dist/components/faq/index.js +3 -3
- package/dist/components/features/index.cjs +3 -3
- package/dist/components/features/index.js +2 -2
- package/dist/components/help-center-pages/index.cjs +23 -23
- package/dist/components/help-center-pages/index.js +14 -14
- package/dist/components/index.cjs +39 -39
- package/dist/components/index.js +13 -13
- package/dist/components/meeting-scheduler/index.cjs +24 -24
- package/dist/components/meeting-scheduler/index.js +2 -2
- package/dist/components/navigation/index.cjs +6 -6
- package/dist/components/navigation/index.js +5 -5
- package/dist/components/onboarding-guides/index.cjs +6 -6
- package/dist/components/onboarding-guides/index.js +5 -5
- package/dist/components/tickets/index.cjs +7 -7
- package/dist/components/tickets/index.js +6 -6
- package/dist/components/ui/index.cjs +3 -3
- package/dist/components/ui/index.js +2 -2
- package/dist/index.cjs +7 -7
- package/dist/index.js +6 -6
- package/dist/platform-domains.cjs +2 -2
- package/dist/platform-domains.cjs.map +1 -1
- package/dist/platform-domains.d.ts +5 -2
- package/dist/platform-domains.d.ts.map +1 -1
- package/dist/platform-domains.js +2 -2
- package/dist/platform-domains.js.map +1 -1
- package/dist/utils/index.cjs +2 -2
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.js +2 -2
- package/dist/utils/index.js.map +1 -1
- package/package.json +1 -1
- package/src/__tests__/platform-domains.test.ts +17 -9
- package/src/platform-domains.ts +6 -3
- package/dist/chunk-KHHFMHYE.cjs.map +0 -1
- /package/dist/{chunk-HQBC7YRF.js.map → chunk-3PGYHT67.js.map} +0 -0
- /package/dist/{chunk-OBBAT4AU.js.map → chunk-6PMUA6JW.js.map} +0 -0
- /package/dist/{chunk-WWPANZTL.js.map → chunk-EI3SLIWL.js.map} +0 -0
- /package/dist/{chunk-N7IAE3DN.js.map → chunk-GSNX2GDA.js.map} +0 -0
- /package/dist/{chunk-EDNZ2HN3.js.map → chunk-HDCIDJSP.js.map} +0 -0
- /package/dist/{chunk-UF5VXOVZ.js.map → chunk-HHE7UNGR.js.map} +0 -0
- /package/dist/{chunk-CYXV5HPV.js.map → chunk-JZVSQT2V.js.map} +0 -0
- /package/dist/{chunk-EBDCDHOT.js.map → chunk-KYIOOOQY.js.map} +0 -0
- /package/dist/{chunk-EADBLRNF.js.map → chunk-MTC6DWVH.js.map} +0 -0
- /package/dist/{chunk-O7LA444D.js.map → chunk-R3CH2ASE.js.map} +0 -0
- /package/dist/{chunk-QP7Z4EN7.js.map → chunk-RUC2V3VH.js.map} +0 -0
- /package/dist/{chunk-REDPQ7F6.js.map → chunk-T36DLNMO.js.map} +0 -0
- /package/dist/{chunk-2SNL36JV.js.map → chunk-ULJNU46H.js.map} +0 -0
- /package/dist/{chunk-DEIYPXGD.js.map → chunk-WSRGTWQL.js.map} +0 -0
- /package/dist/{chunk-IERXOVIS.js.map → chunk-Z7UIO5RQ.js.map} +0 -0
package/package.json
CHANGED
|
@@ -233,17 +233,25 @@ describe('getDeploymentUrl — the one app-origin resolver', () => {
|
|
|
233
233
|
describe('getRequestOrigin / isLocalUrl / resolveRedirectTarget', () => {
|
|
234
234
|
const headers = (values: Record<string, string>) => ({ get: (name: string) => values[name] ?? null });
|
|
235
235
|
|
|
236
|
-
it('reads the host the request arrived on, https unless local, ignoring x-forwarded-host', () => {
|
|
237
|
-
expect(getRequestOrigin(headers({ host: 'www.flamingo.run' }))).toBe(
|
|
238
|
-
expect(getRequestOrigin(headers({ host: 'localhost:3000' }))).toBe('http://localhost:3000');
|
|
239
|
-
expect(getRequestOrigin(headers({ host: '[::1]:3000' }))).toBe('http://[::1]:3000');
|
|
240
|
-
expect(getRequestOrigin(headers({ host: 'x.vercel.app', 'x-forwarded-proto': 'https' }))).toBe(
|
|
241
|
-
'https://x.vercel.app',
|
|
242
|
-
);
|
|
243
|
-
expect(getRequestOrigin(headers({ host: 'www.flamingo.run', 'x-forwarded-host': 'evil.example' }))).toBe(
|
|
236
|
+
it('reads the host the request arrived on, https unless local, ignoring x-forwarded-host, else the app origin', () => {
|
|
237
|
+
expect(getRequestOrigin(headers({ host: 'www.flamingo.run' }), { platform: 'flamingo' })).toBe(
|
|
244
238
|
'https://www.flamingo.run',
|
|
245
239
|
);
|
|
246
|
-
expect(getRequestOrigin(headers({}))).
|
|
240
|
+
expect(getRequestOrigin(headers({ host: 'localhost:3000' }), { platform: 'flamingo' })).toBe(
|
|
241
|
+
'http://localhost:3000',
|
|
242
|
+
);
|
|
243
|
+
expect(getRequestOrigin(headers({ host: '[::1]:3000' }), { platform: 'flamingo' })).toBe('http://[::1]:3000');
|
|
244
|
+
expect(
|
|
245
|
+
getRequestOrigin(headers({ host: 'x.vercel.app', 'x-forwarded-proto': 'https' }), { platform: 'flamingo' }),
|
|
246
|
+
).toBe('https://x.vercel.app');
|
|
247
|
+
expect(
|
|
248
|
+
getRequestOrigin(headers({ host: 'www.flamingo.run', 'x-forwarded-host': 'evil.example' }), {
|
|
249
|
+
platform: 'flamingo',
|
|
250
|
+
}),
|
|
251
|
+
).toBe('https://www.flamingo.run');
|
|
252
|
+
vi.stubGlobal('window', undefined);
|
|
253
|
+
vi.stubEnv('NEXT_PUBLIC_DEV_URL', 'http://localhost:4000');
|
|
254
|
+
expect(getRequestOrigin(headers({}), { platform: 'flamingo' })).toBe('http://localhost:4000');
|
|
247
255
|
});
|
|
248
256
|
|
|
249
257
|
it.each([
|
package/src/platform-domains.ts
CHANGED
|
@@ -209,11 +209,14 @@ export function isLocalUrl(url: string): boolean {
|
|
|
209
209
|
* The origin a server request arrived on, from its `host` header only (what the edge set
|
|
210
210
|
* for this request — a client-writable `x-forwarded-host` never chooses where a flow
|
|
211
211
|
* returns). `http` for a local host unless the proxy says otherwise, else `https`.
|
|
212
|
-
*
|
|
212
|
+
* With no Host header, the app's own origin (`getDeploymentUrl` for `platform`).
|
|
213
213
|
*/
|
|
214
|
-
export function getRequestOrigin(
|
|
214
|
+
export function getRequestOrigin(
|
|
215
|
+
headers: { get(name: string): string | null },
|
|
216
|
+
options: { platform: string; configuredUrl?: string | null },
|
|
217
|
+
): string {
|
|
215
218
|
const host = headers.get('host');
|
|
216
|
-
if (!host) return
|
|
219
|
+
if (!host) return getDeploymentUrl(options);
|
|
217
220
|
const local = LOCAL_HOSTNAME.test(host.replace(/:\d+$/, ''));
|
|
218
221
|
const proto = headers.get('x-forwarded-proto')?.split(',')[0].trim() || (local ? 'http' : 'https');
|
|
219
222
|
return `${proto}://${host}`;
|