parent
75ab146860
commit
c1c955031e
|
@ -34,7 +34,7 @@ export function validateNote(object: any, uri: string) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!validPost.includes(object.type)) {
|
if (!validPost.includes(object.type)) {
|
||||||
return new Error(`invalid Note: invalied object type ${object.type}`);
|
return new Error(`invalid Note: invalid object type ${object.type}`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (object.id && extractDbHost(object.id) !== expectHost) {
|
if (object.id && extractDbHost(object.id) !== expectHost) {
|
||||||
|
|
|
@ -65,7 +65,7 @@ export async function resolveUser(username: string, host: string | null, option?
|
||||||
// validate uri
|
// validate uri
|
||||||
const uri = new URL(self.href);
|
const uri = new URL(self.href);
|
||||||
if (uri.hostname !== host) {
|
if (uri.hostname !== host) {
|
||||||
throw new Error(`Invalied uri`);
|
throw new Error(`Invalid uri`);
|
||||||
}
|
}
|
||||||
|
|
||||||
await Users.update({
|
await Users.update({
|
||||||
|
|
|
@ -40,5 +40,5 @@ function genUrl(query: string) {
|
||||||
return `https://${hostname}/.well-known/webfinger?` + urlQuery({ resource: `acct:${query}` });
|
return `https://${hostname}/.well-known/webfinger?` + urlQuery({ resource: `acct:${query}` });
|
||||||
}
|
}
|
||||||
|
|
||||||
throw new Error(`Invalied query (${query})`);
|
throw new Error(`Invalid query (${query})`);
|
||||||
}
|
}
|
||||||
|
|
|
@ -15,7 +15,7 @@ acct = acct.replace(/^@/, '');
|
||||||
|
|
||||||
// check args
|
// check args
|
||||||
if (!acct.match(/^\w+@\w/)) {
|
if (!acct.match(/^\w+@\w/)) {
|
||||||
throw `Invalied acct format. Valied format are user@host`;
|
throw `Invalid acct format. Valid format are user@host`;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log(`resync ${acct}`);
|
console.log(`resync ${acct}`);
|
||||||
|
|
Loading…
Reference in New Issue