bunderstack 0.24.2 → 0.24.3
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/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to `bunderstack` will be documented in this file.
|
|
4
4
|
|
|
5
|
+
## [0.24.3] — 2026-09-16
|
|
6
|
+
|
|
7
|
+
### Fixed
|
|
8
|
+
|
|
9
|
+
- Prefer the configured `APP_URL` when resolving relative API URLs during
|
|
10
|
+
server-side rendering. Internal HTTP reverse-proxy requests no longer
|
|
11
|
+
override the public HTTPS origin and cause unhandled redirects in RPC
|
|
12
|
+
clients. Browser requests and the request-origin fallback are unchanged.
|
|
13
|
+
|
|
5
14
|
## [0.24.2] — 2026-09-14
|
|
6
15
|
|
|
7
16
|
### Fixed
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SSR-aware fetch: the browser passes `/api/...` through as-is; on the
|
|
3
|
-
* server, relative URLs are resolved against
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* server, relative URLs are resolved against APP_URL when configured. This
|
|
4
|
+
* keeps an internal HTTP reverse-proxy connection from triggering an HTTPS
|
|
5
|
+
* redirect. Without APP_URL, use the incoming request's origin (via
|
|
6
|
+
* @tanstack/react-start/server), then BETTER_AUTH_URL / localhost:3000.
|
|
6
7
|
*
|
|
7
8
|
* The server-only module uses a literal dynamic import so bundlers can analyze
|
|
8
9
|
* the boundary statically; the `window` guard means it never runs in browsers.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isomorphic-fetch.d.ts","sourceRoot":"","sources":["../../src/start/isomorphic-fetch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"isomorphic-fetch.d.ts","sourceRoot":"","sources":["../../src/start/isomorphic-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,KAAK,CAAA;CAAO,IAGxE,OAAO,WAAW,GAAG,GAAG,EACxB,OAAO,WAAW,KACjB,OAAO,CAAC,QAAQ,CAAC,CAiBrB"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* SSR-aware fetch: the browser passes `/api/...` through as-is; on the
|
|
3
|
-
* server, relative URLs are resolved against
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* server, relative URLs are resolved against APP_URL when configured. This
|
|
4
|
+
* keeps an internal HTTP reverse-proxy connection from triggering an HTTPS
|
|
5
|
+
* redirect. Without APP_URL, use the incoming request's origin (via
|
|
6
|
+
* @tanstack/react-start/server), then BETTER_AUTH_URL / localhost:3000.
|
|
6
7
|
*
|
|
7
8
|
* The server-only module uses a literal dynamic import so bundlers can analyze
|
|
8
9
|
* the boundary statically; the `window` guard means it never runs in browsers.
|
|
@@ -13,18 +14,17 @@ export function createIsomorphicFetch(options = {}) {
|
|
|
13
14
|
if (typeof window !== 'undefined')
|
|
14
15
|
return inner(input, init);
|
|
15
16
|
if (typeof input === 'string' && input.startsWith('/')) {
|
|
16
|
-
let origin;
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
let origin = process.env.APP_URL;
|
|
18
|
+
if (origin === undefined) {
|
|
19
|
+
try {
|
|
20
|
+
const mod = await import('@tanstack/react-start/server');
|
|
21
|
+
origin = new URL(mod.getRequest().url).origin;
|
|
22
|
+
}
|
|
23
|
+
catch {
|
|
24
|
+
// No request context (background job, test) — fall through to env.
|
|
25
|
+
}
|
|
20
26
|
}
|
|
21
|
-
|
|
22
|
-
// No request context (background job, test) — fall through to env.
|
|
23
|
-
}
|
|
24
|
-
origin ??=
|
|
25
|
-
process.env.APP_URL ??
|
|
26
|
-
process.env.BETTER_AUTH_URL ??
|
|
27
|
-
'http://localhost:3000';
|
|
27
|
+
origin ??= process.env.BETTER_AUTH_URL ?? 'http://localhost:3000';
|
|
28
28
|
return inner(new URL(input, origin), init);
|
|
29
29
|
}
|
|
30
30
|
return inner(input, init);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isomorphic-fetch.js","sourceRoot":"","sources":["../../src/start/isomorphic-fetch.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"isomorphic-fetch.js","sourceRoot":"","sources":["../../src/start/isomorphic-fetch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAoC,EAAE;IAC1E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,IAAI,KAAK,CAAA;IACpC,OAAO,KAAK,UAAU,eAAe,CACnC,KAAwB,EACxB,IAAkB;QAElB,IAAI,OAAO,MAAM,KAAK,WAAW;YAAE,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;QAC5D,IAAI,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;YACvD,IAAI,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,OAAO,CAAA;YAChC,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;gBACzB,IAAI,CAAC;oBACH,MAAM,GAAG,GAAG,MAAM,MAAM,CAAC,8BAA8B,CAAC,CAAA;oBACxD,MAAM,GAAG,IAAI,GAAG,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC,GAAG,CAAC,CAAC,MAAM,CAAA;gBAC/C,CAAC;gBAAC,MAAM,CAAC;oBACP,mEAAmE;gBACrE,CAAC;YACH,CAAC;YACD,MAAM,KAAK,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,uBAAuB,CAAA;YACjE,OAAO,KAAK,CAAC,IAAI,GAAG,CAAC,KAAK,EAAE,MAAM,CAAC,EAAE,IAAI,CAAC,CAAA;QAC5C,CAAC;QACD,OAAO,KAAK,CAAC,KAAK,EAAE,IAAI,CAAC,CAAA;IAC3B,CAAC,CAAA;AACH,CAAC","sourcesContent":["/**\n * SSR-aware fetch: the browser passes `/api/...` through as-is; on the\n * server, relative URLs are resolved against APP_URL when configured. This\n * keeps an internal HTTP reverse-proxy connection from triggering an HTTPS\n * redirect. Without APP_URL, use the incoming request's origin (via\n * @tanstack/react-start/server), then BETTER_AUTH_URL / localhost:3000.\n *\n * The server-only module uses a literal dynamic import so bundlers can analyze\n * the boundary statically; the `window` guard means it never runs in browsers.\n */\nexport function createIsomorphicFetch(options: { fetch?: typeof fetch } = {}) {\n const inner = options.fetch ?? fetch\n return async function isomorphicFetch(\n input: RequestInfo | URL,\n init?: RequestInit,\n ): Promise<Response> {\n if (typeof window !== 'undefined') return inner(input, init)\n if (typeof input === 'string' && input.startsWith('/')) {\n let origin = process.env.APP_URL\n if (origin === undefined) {\n try {\n const mod = await import('@tanstack/react-start/server')\n origin = new URL(mod.getRequest().url).origin\n } catch {\n // No request context (background job, test) — fall through to env.\n }\n }\n origin ??= process.env.BETTER_AUTH_URL ?? 'http://localhost:3000'\n return inner(new URL(input, origin), init)\n }\n return inner(input, init)\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bunderstack",
|
|
3
|
-
"version": "0.24.
|
|
3
|
+
"version": "0.24.3",
|
|
4
4
|
"description": "Batteries-included backend framework for Bun: type-safe oRPC APIs, auth, storage, realtime, jobs, messaging, and validated env from one declaration.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"backend",
|