validate that note attributed to is not local

This commit is contained in:
Johann150 2023-05-28 23:24:39 +02:00
parent cc342f1443
commit c9df2fd060
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 3 additions and 0 deletions

View File

@ -52,6 +52,9 @@ export function validateNote(object: IObject): Error | null {
if (attributedToHost !== expectHost) {
return new Error(`invalid Note: attributedTo has different host. expected: ${expectHost}, actual: ${attributedToHost}`);
}
if (attributedToHost === config.hostname) {
return new Error('invalid Note: by local author');
}
return null;
}