a collection of lightweight TypeScript packages for AT Protocol, the protocol powering Bluesky
atproto bluesky typescript npm
101
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(identity-resolver): use `manual` redirect instead of `error`

Mary 876c776f 820eb09c

+32 -4
+12
.changeset/slow-chefs-tap.md
··· 1 + --- 2 + '@atcute/identity-resolver': patch 3 + --- 4 + 5 + use `manual` redirect instead of `error` 6 + 7 + apparently Cloudflare Workers doesn't think it makes sense for edge runtimes to support it, but how 8 + exactly? who knows. 9 + 10 + ``` 11 + TypeError: Invalid redirect value, must be one of "follow" or "manual" ("error" won't be implemented since it does not make sense at the edge; use "manual" and check the response status code). 12 + ```
+5 -1
packages/identity/identity-resolver/lib/did/methods/plc.ts
··· 37 37 const response = await (0, this.#fetch)(url, { 38 38 signal: options?.signal, 39 39 cache: options?.noCache ? 'no-cache' : undefined, 40 - redirect: 'error', 40 + redirect: 'manual', 41 41 headers: { accept: 'application/did+ld+json,application/json' }, 42 42 }); 43 + 44 + if (response.status >= 300 && response.status < 400) { 45 + throw new TypeError(`unexpected redirect`); 46 + } 43 47 44 48 const handled = await fetchDocHandler(response); 45 49
+10 -2
packages/identity/identity-resolver/lib/did/methods/web.ts
··· 31 31 const response = await (0, this.#fetch)(url, { 32 32 signal: options?.signal, 33 33 cache: options?.noCache ? 'no-cache' : undefined, 34 - redirect: 'error', 34 + redirect: 'manual', 35 35 headers: { accept: 'application/did+ld+json,application/json' }, 36 36 }); 37 + 38 + if (response.status >= 300 && response.status < 400) { 39 + throw new TypeError(`unexpected redirect`); 40 + } 37 41 38 42 const handled = await fetchDocHandler(response); 39 43 ··· 76 80 const response = await (0, this.#fetch)(url, { 77 81 signal: options?.signal, 78 82 cache: options?.noCache ? 'no-cache' : undefined, 79 - redirect: 'error', 83 + redirect: 'manual', 80 84 headers: { accept: 'application/did+ld+json,application/json' }, 81 85 }); 86 + 87 + if (response.status >= 300 && response.status < 400) { 88 + throw new TypeError(`unexpected redirect`); 89 + } 82 90 83 91 const handled = await fetchDocHandler(response); 84 92
+5 -1
packages/identity/identity-resolver/lib/handle/methods/well-known.ts
··· 27 27 const response = await (0, this.#fetch)(url, { 28 28 signal: options?.signal, 29 29 cache: options?.noCache ? 'no-cache' : undefined, 30 - redirect: 'error', 30 + redirect: 'manual', 31 31 }); 32 + 33 + if (response.status >= 300 && response.status < 400) { 34 + throw new TypeError(`unexpected redirect`); 35 + } 32 36 33 37 const handled = await fetchWellKnownHandler(response); 34 38