feat: filter invalid pubkeys in the follow list
This commit is contained in:
parent
cbae26e492
commit
9c0fa6257a
2 changed files with 6 additions and 1 deletions
|
|
@ -42,6 +42,10 @@ export function userIdToPubkey(userId: string) {
|
|||
return userId
|
||||
}
|
||||
|
||||
export function isValidPubkey(pubkey: string) {
|
||||
return /^[0-9a-f]{64}$/.test(pubkey)
|
||||
}
|
||||
|
||||
const pubkeyImageCache = new LRUCache<string, string>({ max: 1000 })
|
||||
export function generateImageByPubkey(pubkey: string): string {
|
||||
if (pubkeyImageCache.has(pubkey)) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue