@hyperspan/framework 1.0.23 → 1.0.24

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hyperspan/framework",
3
- "version": "1.0.23",
3
+ "version": "1.0.24",
4
4
  "description": "Hyperspan Web Framework",
5
5
  "main": "src/server.ts",
6
6
  "types": "src/server.ts",
@@ -107,8 +107,12 @@ function formSubmitToRoute(e: Event, form: HTMLFormElement, opts: TFormSubmitOpt
107
107
  if (newUrl) {
108
108
  const resolved = new URL(newUrl, window.location.href);
109
109
 
110
- // If the new URL is the same as the current URL, we can just fetch the new HTML and apply it
111
- if (resolved.pathname === window.location.pathname) {
110
+ // Same-origin + same path: fetch updated HTML and morph in place. Cross-origin redirects
111
+ // must use full navigation (CORS and Idiomorph are not safe across domains).
112
+ if (
113
+ resolved.origin === window.location.origin &&
114
+ resolved.pathname === window.location.pathname
115
+ ) {
112
116
  const pageRes = await fetch(resolved.href, {
113
117
  headers: { Accept: 'text/html' },
114
118
  });