deliver-delayed で URL のパースに失敗した際に全てがコケる問題を修正 (#164)
* deliver-delayed で URL のパースに失敗した際に全てがコケる問題を修正 * validateActor に inbox / sharedInbox のバリデーションを追加 * fix quote * 念のため inbox-delayed も
This commit is contained in:
		| @@ -153,6 +153,21 @@ export class ApPersonService implements OnModuleInit { | ||||
| 			throw new Error('invalid Actor: wrong inbox'); | ||||
| 		} | ||||
|  | ||||
| 		try { | ||||
| 			new URL(x.inbox); | ||||
| 		} catch { | ||||
| 			throw new Error('invalid Actor: wrong inbox'); | ||||
| 		} | ||||
|  | ||||
| 		const sharedInbox = x.sharedInbox ?? x.endpoints?.sharedInbox; | ||||
| 		if (typeof sharedInbox === 'string') { | ||||
| 			try { | ||||
| 				new URL(sharedInbox); | ||||
| 			} catch { | ||||
| 				throw new Error('invalid Actor: wrong sharedInbox'); | ||||
| 			} | ||||
| 		} | ||||
|  | ||||
| 		if (!(typeof x.preferredUsername === 'string' && x.preferredUsername.length > 0 && x.preferredUsername.length <= 128 && /^\w([\w-.]*\w)?$/.test(x.preferredUsername))) { | ||||
| 			throw new Error('invalid Actor: wrong username'); | ||||
| 		} | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 riku6460
					riku6460