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 0d952fa commit 183fb91Copy full SHA for 183fb91
1 file changed
server/api/atproto/bluesky-author-profiles.get.ts
@@ -4,6 +4,7 @@ import { AuthorSchema } from '#shared/schemas/blog'
4
import { Client } from '@atproto/lex'
5
import type { Author, ResolvedAuthor } from '#shared/schemas/blog'
6
import * as app from '#shared/types/lexicons/app'
7
+import * as crypto from 'node:crypto'
8
9
export default defineCachedEventHandler(
10
async event => {
@@ -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
+ if (!authors) {
80
+ return 'author-profiles:npmx.dev'
81
+ }
82
+ const key = crypto.createHash('sha256').update(JSON.stringify(authors)).digest('hex')
83
+ return `author-profiles:${key}`
84
},
85
86
)
0 commit comments