Fix #2326 - Redirect to localhost when on 0.0.0.0 (#2328)

* Fix #2326 - Redirect to localhost when on 0.0.0.0
This commit is contained in:
Andrea Giammarchi
2025-04-14 15:55:10 +02:00
committed by GitHub
parent b911ea99fb
commit 16ebc50481
2 changed files with 8 additions and 0 deletions

View File

@@ -1,5 +1,6 @@
/*! (c) PyScript Development Team */
import "./zero-redirect.js";
import stickyModule from "sticky-module";
import "@ungap/with-resolvers";

View File

@@ -0,0 +1,7 @@
/* eslint no-unused-vars: 0 */
try {
crypto.randomUUID();
} catch (_) {
if (location.href.startsWith("http://0.0.0.0"))
location.href = location.href.replace("0.0.0.0", "localhost");
}