From 27bf7445da2468328b6ad2ace6bb7e6fa24b48e2 Mon Sep 17 00:00:00 2001 From: bnewbold Date: Tue, 12 Sep 2023 14:04:55 -0700 Subject: [PATCH] identity: don't remove non-ASCII characters simplifies what we are normalizing: just take the first line and strip whitespace, don't try to remove any non-ASCII characters as well. --- packages/identity/src/handle/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/packages/identity/src/handle/index.ts b/packages/identity/src/handle/index.ts index f4aafde4404..4048f963cd5 100644 --- a/packages/identity/src/handle/index.ts +++ b/packages/identity/src/handle/index.ts @@ -50,8 +50,7 @@ export class HandleResolver { const url = new URL('/.well-known/atproto-did', `https://${handle}`) try { const res = await fetch(url, { signal }) - const asciiText = (await res.text()).replace(/[^\x00-\x7F]/g, "") - const did = asciiText.split('\n')[0].trim() + const did = (await res.text()).split('\n')[0].trim() if (typeof did === 'string' && did.startsWith('did:')) { return did }