Enable stricter Typescript options (#30435)
This commit is contained in:
parent
564ebfefcf
commit
3750e8050c
9 changed files with 36 additions and 16 deletions
|
@ -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}` },
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue