Fetch homeUrl from .well-known (#7790)
* Fetch homeUrl from .well-known * homeUrl: prefer config.json over .well-known * homeUrl: prefer deprecated config.json variant over .well-known * Apply suggestions from code review Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Michael Telatynski <7t3chguy@gmail.com> Co-authored-by: Travis Ralston <travisr@matrix.org>
This commit is contained in:
co-authored by
Michael Telatynski
Travis Ralston
parent
e87ef3b6ab
commit
b776cc8c1f
@@ -17,6 +17,7 @@ limitations under the License.
|
||||
import { logger } from "matrix-js-sdk/src/logger";
|
||||
|
||||
import { IConfigOptions } from "../IConfigOptions";
|
||||
import { getEmbeddedPagesWellKnown } from '../utils/WellKnownUtils';
|
||||
import { SnakedObject } from "./SnakedObject";
|
||||
|
||||
export function getHomePageUrl(appConfig: IConfigOptions): string | null {
|
||||
@@ -38,6 +39,10 @@ export function getHomePageUrl(appConfig: IConfigOptions): string | null {
|
||||
}
|
||||
}
|
||||
|
||||
if (!pageUrl) {
|
||||
pageUrl = getEmbeddedPagesWellKnown()?.home_url;
|
||||
}
|
||||
|
||||
return pageUrl;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user