We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f458531 commit 3907a78Copy full SHA for 3907a78
1 file changed
server/api/atproto/bluesky-author-profiles.get.ts
@@ -1,4 +1,5 @@
1
import * as v from 'valibot'
2
+import crypto from 'node:crypto'
3
import { CACHE_MAX_AGE_ONE_DAY, BLUESKY_API } from '#shared/utils/constants'
4
import { AuthorSchema } from '#shared/schemas/blog'
5
import { Client } from '@atproto/lex'
@@ -75,7 +76,11 @@ export default defineCachedEventHandler(
75
76
maxAge: CACHE_MAX_AGE_ONE_DAY,
77
getKey: event => {
78
const { authors } = getQuery(event)
- return `author-profiles:${authors ?? 'npmx.dev'}`
79
+ const hash = crypto
80
+ .createHash('md5')
81
+ .update(JSON.stringify(authors ?? 'npmx.dev'))
82
+ .digest('hex')
83
+ return `author-profiles:${hash}`
84
},
85
86
)
0 commit comments