mirror of
https://github.com/SchildiChat/element-web.git
synced 2024-10-01 01:26:12 -04:00
Handle trailing dot FQDNs for domain-specific config.json files (#25351)
This commit is contained in:
parent
9457af27f6
commit
d7a98fe392
@ -21,7 +21,13 @@ import type { IConfigOptions } from "matrix-react-sdk/src/IConfigOptions";
|
||||
export async function getVectorConfig(relativeLocation = ""): Promise<IConfigOptions | undefined> {
|
||||
if (relativeLocation !== "" && !relativeLocation.endsWith("/")) relativeLocation += "/";
|
||||
|
||||
const specificConfigPromise = getConfig(`${relativeLocation}config.${window.location.hostname}.json`);
|
||||
// Handle trailing dot FQDNs
|
||||
let domain = window.location.hostname.trimEnd();
|
||||
if (domain[domain.length - 1] === ".") {
|
||||
domain = domain.slice(0, -1);
|
||||
}
|
||||
|
||||
const specificConfigPromise = getConfig(`${relativeLocation}config.${domain}.json`);
|
||||
const generalConfigPromise = getConfig(relativeLocation + "config.json");
|
||||
|
||||
try {
|
||||
|
Loading…
Reference in New Issue
Block a user