From 42d73964ec233362640a35ca4416c9950eb2ede3 Mon Sep 17 00:00:00 2001 From: Matthieu Sieben Date: Thu, 23 Jan 2025 13:57:36 +0100 Subject: [PATCH] Allow forcing handle resolution based on cache-control --- .changeset/eighty-chefs-float.md | 5 +++++ packages/bsky/src/api/com/atproto/identity/resolveHandle.ts | 4 +++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 .changeset/eighty-chefs-float.md diff --git a/.changeset/eighty-chefs-float.md b/.changeset/eighty-chefs-float.md new file mode 100644 index 00000000000..31a228cdf90 --- /dev/null +++ b/.changeset/eighty-chefs-float.md @@ -0,0 +1,5 @@ +--- +"@atproto/bsky": patch +--- + +Allow forcing handle resolution based on cache-control diff --git a/packages/bsky/src/api/com/atproto/identity/resolveHandle.ts b/packages/bsky/src/api/com/atproto/identity/resolveHandle.ts index 6cb524c6ec2..f417e4a84f2 100644 --- a/packages/bsky/src/api/com/atproto/identity/resolveHandle.ts +++ b/packages/bsky/src/api/com/atproto/identity/resolveHandle.ts @@ -7,7 +7,9 @@ export default function (server: Server, ctx: AppContext) { server.com.atproto.identity.resolveHandle(async ({ req, params }) => { const handle = ident.normalizeHandle(params.handle || req.hostname) - let [did] = await ctx.hydrator.actor.getDids([handle]) + let [did] = req.headers['cache-control']?.includes('no-cache') + ? [undefined] + : await ctx.hydrator.actor.getDids([handle]) if (!did) { const publicHostname = ctx.cfg.publicUrl