@void/platform 0.26.1 → 0.27.0
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/README.md
CHANGED
package/dist/index.mjs
CHANGED
|
@@ -956,7 +956,11 @@ function normalizeOrigin(value, name) {
|
|
|
956
956
|
} catch {
|
|
957
957
|
throw new Error(`${name} must be an absolute URL.`);
|
|
958
958
|
}
|
|
959
|
-
if (!(url.protocol === "http:" &&
|
|
959
|
+
if (!(url.protocol === "http:" && [
|
|
960
|
+
"localhost",
|
|
961
|
+
"127.0.0.1",
|
|
962
|
+
"[::1]"
|
|
963
|
+
].includes(url.hostname)) && url.protocol !== "https:" || url.username || url.password) throw new Error(`${name} must be a credential-free HTTPS URL.`);
|
|
960
964
|
if (url.pathname !== "" && url.pathname !== "/" || url.search || url.hash) throw new Error(`${name} must be an origin without a path, query, or fragment.`);
|
|
961
965
|
return url.origin;
|
|
962
966
|
}
|