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

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;
}