0
0
Fork 0

Enable stricter Typescript options (#30435)

This commit is contained in:
Renaud Chaput 2024-05-27 11:24:59 +02:00 committed by GitHub
parent 564ebfefcf
commit 3750e8050c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 36 additions and 16 deletions

View file

@ -67,7 +67,9 @@ const fetchInteractionURLFailure = () => {
);
};
const isValidDomain = (value: string) => {
const isValidDomain = (value: unknown) => {
if (typeof value !== 'string') return false;
const url = new URL('https:///path');
url.hostname = value;
return url.hostname === value;
@ -124,6 +126,11 @@ const fromAcct = (acct: string) => {
const domain = segments[1];
const fallbackTemplate = `https://${domain}/authorize_interaction?uri={uri}`;
if (!domain) {
fetchInteractionURLFailure();
return;
}
axios
.get(`https://${domain}/.well-known/webfinger`, {
params: { resource: `acct:${acct}` },