Handle case of no access token for /versions

pull/27326/head
Travis Ralston 2024-04-23 14:10:52 -06:00
parent c20d5f1e75
commit 3947d903f9
1 changed files with 3 additions and 2 deletions

View File

@ -107,11 +107,12 @@ async function tryUpdateServerSupportMap(clientApiUrl: string, accessToken?: str
return; // up to date
}
const versions = await (await fetch(`${clientApiUrl}/_matrix/client/versions`, {
const config = !accessToken ? undefined : {
headers: {
Authorization: `Bearer ${accessToken}`,
},
})).json();
};
const versions = await (await fetch(`${clientApiUrl}/_matrix/client/versions`, config)).json();
serverSupportMap[clientApiUrl] = {
supportsMSC3916: Boolean(versions?.unstable_features?.["org.matrix.msc3916"]),