@copilotkit/core 1.71.0 → 1.71.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.
- package/dist/index.cjs +3 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +3 -2
- package/dist/index.mjs.map +1 -1
- package/dist/index.umd.js +4 -3
- package/dist/index.umd.js.map +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1031,9 +1031,10 @@ async function readResourceBody(input, init, headers, method) {
|
|
|
1031
1031
|
* through unchanged.
|
|
1032
1032
|
*/
|
|
1033
1033
|
async function createSingleRouteResourceRequest(input, init, runtimeUrl) {
|
|
1034
|
-
const
|
|
1034
|
+
const baseUrl = typeof window !== "undefined" && window.location?.href ? window.location.href : "http://localhost";
|
|
1035
|
+
const runtime = new URL(runtimeUrl, baseUrl);
|
|
1035
1036
|
const inputUrl = input instanceof Request ? input.url : input instanceof URL ? input.href : input;
|
|
1036
|
-
const target = new URL(inputUrl,
|
|
1037
|
+
const target = new URL(inputUrl, baseUrl);
|
|
1037
1038
|
const runtimePath = runtime.pathname.replace(/\/$/, "");
|
|
1038
1039
|
if (target.origin !== runtime.origin) return null;
|
|
1039
1040
|
if (!target.pathname.startsWith(`${runtimePath}/`)) return null;
|