@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
|
@@ -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
|
-
//
|
|
111
|
-
|
|
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
|
});
|