@le-space/browser 0.6.26 → 0.6.27
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/index.js +7 -3
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -49,11 +49,10 @@ async function fetchWithTimeout(input, init = {}, timeoutMs = 15e3) {
|
|
|
49
49
|
|
|
50
50
|
// src/aleph-api.ts
|
|
51
51
|
var DEFAULT_ALEPH_API_HOSTS = [
|
|
52
|
-
"https://api3.aleph.im",
|
|
53
52
|
"https://api2.aleph.im",
|
|
54
53
|
"https://api.aleph.im"
|
|
55
54
|
];
|
|
56
|
-
var DEFAULT_ALEPH_API_HOST = DEFAULT_ALEPH_API_HOSTS[0] ?? "https://
|
|
55
|
+
var DEFAULT_ALEPH_API_HOST = DEFAULT_ALEPH_API_HOSTS[0] ?? "https://api2.aleph.im";
|
|
57
56
|
var DEFAULT_CRN_LIST_URL = "https://crns-list.aleph.sh/crns.json";
|
|
58
57
|
var DEFAULT_ALEPH_SCHEDULER_API_HOST = "https://scheduler.api.aleph.cloud";
|
|
59
58
|
var DEFAULT_2N6_API_HOST = "https://api.2n6.me";
|
|
@@ -478,7 +477,12 @@ async function broadcastAlephMessage(message, apiHost = DEFAULT_ALEPH_API_HOST,
|
|
|
478
477
|
// src/client.ts
|
|
479
478
|
function normalizeApiHost(value) {
|
|
480
479
|
const trimmed = value.trim().replace(/\/+$/u, "");
|
|
481
|
-
|
|
480
|
+
if (!trimmed) return null;
|
|
481
|
+
try {
|
|
482
|
+
if (new URL(trimmed).hostname.toLowerCase() === "api3.aleph.im") return null;
|
|
483
|
+
} catch {
|
|
484
|
+
}
|
|
485
|
+
return trimmed;
|
|
482
486
|
}
|
|
483
487
|
function normalizeApiHosts(input, fallbackApiHost) {
|
|
484
488
|
const rawValues = Array.isArray(input) ? input : typeof input === "string" ? input.split(/[\s,]+/u) : [];
|