aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFuwn <[email protected]>2026-04-18 08:48:07 +0000
committerFuwn <[email protected]>2026-04-18 08:48:07 +0000
commit3f422fd577b59ac1d55fd8b83f775e696c7c05e4 (patch)
tree15df5f86022599e1a94202979508fac74722859f
parentfix(dev): route portless .localhost URL through app origin and proxy CORS (diff)
downloaddue.moe-3f422fd577b59ac1d55fd8b83f775e696c7c05e4.tar.xz
due.moe-3f422fd577b59ac1d55fd8b83f775e696c7c05e4.zip
fix(utility): treat .localhost subdomains as private in appOrigin
-rw-r--r--src/lib/Utility/appOrigin.ts1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/lib/Utility/appOrigin.ts b/src/lib/Utility/appOrigin.ts
index cdc53995..1e2c6708 100644
--- a/src/lib/Utility/appOrigin.ts
+++ b/src/lib/Utility/appOrigin.ts
@@ -11,6 +11,7 @@ const isPrivateHostname = (hostname: string) =>
hostname === "localhost" ||
hostname === "127.0.0.1" ||
hostname.endsWith(".local") ||
+ hostname.endsWith(".localhost") ||
/^10\./.test(hostname) ||
/^192\.168\./.test(hostname) ||
/^172\.(1[6-9]|2\d|3[0-1])\./.test(hostname);