Loading packages/fedify/src/runtime/authdocloader.ts +7 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ export function getAuthenticatedDocumentLoader( validateCryptoKey(identity.privateKey); async function load( url: string, _options?: DocumentLoaderOptions, options?: DocumentLoaderOptions, ): Promise<RemoteDocument> { if (!allowPrivateAddress) { try { Loading @@ -77,7 +77,12 @@ export function getAuthenticatedDocumentLoader( const response = await doubleKnock( originalRequest, identity, { specDeterminer, log: logRequest, tracerProvider }, { specDeterminer, log: logRequest, tracerProvider, signal: options?.signal, }, ); return getRemoteDocument(url, response, load); } Loading packages/fedify/src/sig/http.ts +8 −1 Original line number Diff line number Diff line Loading @@ -1237,6 +1237,11 @@ export interface DoubleKnockOptions { * is used. */ tracerProvider?: TracerProvider; /** * An `AbortSignal` for cancellation. */ signal?: AbortSignal; } /** Loading Loading @@ -1283,7 +1288,7 @@ export async function doubleKnock( identity: { keyId: URL; privateKey: CryptoKey }, options: DoubleKnockOptions = {}, ): Promise<Response> { const { specDeterminer, log, tracerProvider } = options; const { specDeterminer, log, tracerProvider, signal } = options; const origin = new URL(request.url).origin; const firstTrySpec: HttpMessageSignaturesSpec = specDeterminer == null ? "rfc9421" Loading @@ -1308,6 +1313,7 @@ export async function doubleKnock( // to work around it we specify `redirect: "manual"` here too: // https://github.com/oven-sh/bun/issues/10754 redirect: "manual", signal, }); // Follow redirects manually to get the final URL: if ( Loading Loading @@ -1355,6 +1361,7 @@ export async function doubleKnock( // to work around it we specify `redirect: "manual"` here too: // https://github.com/oven-sh/bun/issues/10754 redirect: "manual", signal, }); // Follow redirects manually to get the final URL: if ( Loading Loading
packages/fedify/src/runtime/authdocloader.ts +7 −2 Original line number Diff line number Diff line Loading @@ -61,7 +61,7 @@ export function getAuthenticatedDocumentLoader( validateCryptoKey(identity.privateKey); async function load( url: string, _options?: DocumentLoaderOptions, options?: DocumentLoaderOptions, ): Promise<RemoteDocument> { if (!allowPrivateAddress) { try { Loading @@ -77,7 +77,12 @@ export function getAuthenticatedDocumentLoader( const response = await doubleKnock( originalRequest, identity, { specDeterminer, log: logRequest, tracerProvider }, { specDeterminer, log: logRequest, tracerProvider, signal: options?.signal, }, ); return getRemoteDocument(url, response, load); } Loading
packages/fedify/src/sig/http.ts +8 −1 Original line number Diff line number Diff line Loading @@ -1237,6 +1237,11 @@ export interface DoubleKnockOptions { * is used. */ tracerProvider?: TracerProvider; /** * An `AbortSignal` for cancellation. */ signal?: AbortSignal; } /** Loading Loading @@ -1283,7 +1288,7 @@ export async function doubleKnock( identity: { keyId: URL; privateKey: CryptoKey }, options: DoubleKnockOptions = {}, ): Promise<Response> { const { specDeterminer, log, tracerProvider } = options; const { specDeterminer, log, tracerProvider, signal } = options; const origin = new URL(request.url).origin; const firstTrySpec: HttpMessageSignaturesSpec = specDeterminer == null ? "rfc9421" Loading @@ -1308,6 +1313,7 @@ export async function doubleKnock( // to work around it we specify `redirect: "manual"` here too: // https://github.com/oven-sh/bun/issues/10754 redirect: "manual", signal, }); // Follow redirects manually to get the final URL: if ( Loading Loading @@ -1355,6 +1361,7 @@ export async function doubleKnock( // to work around it we specify `redirect: "manual"` here too: // https://github.com/oven-sh/bun/issues/10754 redirect: "manual", signal, }); // Follow redirects manually to get the final URL: if ( Loading