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: do not pass URL instances to fetch()

Mary 387b2919 aeb959a8

+13 -6
+7
.changeset/fuzzy-rice-enjoy.md
··· 1 + --- 2 + '@atcute/oauth-browser-client': patch 3 + '@atcute/lex-cli': patch 4 + '@atcute/client': patch 5 + --- 6 + 7 + do not pass URL instances to fetch()
+1 -1
packages/clients/client/lib/fetch-handler.ts
··· 25 25 }: SimpleFetchHandlerOptions): FetchHandler => { 26 26 return async (pathname, init) => { 27 27 const url = new URL(pathname, service); 28 - return await _fetch(url, init); 28 + return await _fetch(url.href, init); 29 29 }; 30 30 };
+1 -1
packages/lexicons/lex-cli/src/pull-sources/atproto.ts
··· 54 54 url.searchParams.set('cursor', cursor); 55 55 } 56 56 57 - const response = await fetch(url, { 57 + const response = await fetch(url.href, { 58 58 headers: { accept: 'application/json' }, 59 59 }); 60 60
+2 -2
packages/oauth/browser-client/lib/agents/user-agent.ts
··· 56 56 57 57 headers.set('authorization', `${session.token.type} ${session.token.access}`); 58 58 59 - let response = await this.#fetch(url, { ...init, headers }); 59 + let response = await this.#fetch(url.href, { ...init, headers }); 60 60 if (!isInvalidTokenResponse(response)) { 61 61 return response; 62 62 } ··· 79 79 url = new URL(pathname, session.info.aud); 80 80 headers.set('authorization', `${session.token.type} ${session.token.access}`); 81 81 82 - return await this.#fetch(url, { ...init, headers }); 82 + return await this.#fetch(url.href, { ...init, headers }); 83 83 } 84 84 } 85 85
+2 -2
packages/oauth/browser-client/lib/resolvers.ts
··· 38 38 39 39 const getProtectedResourceMetadata = async (host: string): Promise<ProtectedResourceMetadata> => { 40 40 const url = new URL(`/.well-known/oauth-protected-resource`, host); 41 - const response = await fetch(url, { 41 + const response = await fetch(url.href, { 42 42 redirect: 'manual', 43 43 headers: { 44 44 accept: 'application/json', ··· 59 59 60 60 const getAuthorizationServerMetadata = async (host: string): Promise<AuthorizationServerMetadata> => { 61 61 const url = new URL(`/.well-known/oauth-authorization-server`, host); 62 - const response = await fetch(url, { 62 + const response = await fetch(url.href, { 63 63 redirect: 'manual', 64 64 headers: { 65 65 accept: 'application/json',