mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
Fix a potential error related to some DNS records
This commit is contained in:
parent
84f3977fd4
commit
766700ffd9
@ -40,6 +40,10 @@ export async function getFederationUrl(serverName: string): Promise<string> {
|
|||||||
LogService.warn("matrix", "Could not find _matrix._tcp." + serverName + " DNS record. This is normal for most servers.");
|
LogService.warn("matrix", "Could not find _matrix._tcp." + serverName + " DNS record. This is normal for most servers.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(expirationMs > 0)) { // This is weird so we can catch NaN easier
|
||||||
|
expirationMs = 4 * 60 * 60 * 1000;
|
||||||
|
}
|
||||||
|
|
||||||
if (!serverUrl) serverUrl = "https://" + serverName + ":8448";
|
if (!serverUrl) serverUrl = "https://" + serverName + ":8448";
|
||||||
LogService.verbose("matrix", "Federation URL for " + serverName + " is " + serverUrl + " - caching for " + expirationMs + " ms");
|
LogService.verbose("matrix", "Federation URL for " + serverName + " is " + serverUrl + " - caching for " + expirationMs + " ms");
|
||||||
Cache.for(CACHE_FEDERATION).put(serverName, serverUrl, expirationMs);
|
Cache.for(CACHE_FEDERATION).put(serverName, serverUrl, expirationMs);
|
||||||
|
Loading…
Reference in New Issue
Block a user