mirror of
https://github.com/pyscript/pyscript.git
synced 2025-12-19 10:17:23 -05:00
* Fix #2326 - Redirect to localhost when on 0.0.0.0
This commit is contained in:
committed by
GitHub
parent
b911ea99fb
commit
16ebc50481
@@ -1,5 +1,6 @@
|
||||
/*! (c) PyScript Development Team */
|
||||
|
||||
import "./zero-redirect.js";
|
||||
import stickyModule from "sticky-module";
|
||||
import "@ungap/with-resolvers";
|
||||
|
||||
|
||||
7
core/src/zero-redirect.js
Normal file
7
core/src/zero-redirect.js
Normal 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");
|
||||
}
|
||||
Reference in New Issue
Block a user