@fedify/fedify 2.4.5-dev.2462 → 2.4.6-dev.2628
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -0
- package/dist/{builder-BBUGd9wr.mjs → builder-kj5boG2l.mjs} +2 -2
- package/dist/{client-D-XP_Ccb.d.cts → client-3InDZbba.d.cts} +0 -1
- package/dist/{client-D-XP_Ccb.d.ts → client-3InDZbba.d.ts} +0 -1
- package/dist/{client-CEnNz8O7.mjs → client-5SIFzW3q.mjs} +113 -64
- package/dist/compat/mod.d.cts +1 -1
- package/dist/compat/mod.d.ts +1 -1
- package/dist/compat/transformers.test.mjs +1 -1
- package/dist/{compound-proof-CariICma.mjs → compound-proof-BoNAYSHt.mjs} +2 -2
- package/dist/{context-7NyiqIcg.d.ts → context-CVOOd9pD.d.ts} +28 -2
- package/dist/{context-tsYPJ2Ew.d.cts → context-D0gFIgev.d.cts} +28 -2
- package/dist/{deno-BO7-a3hz.mjs → deno-ksnVeCA7.mjs} +1 -1
- package/dist/docloader-BhVNi06k.mjs +136 -0
- package/dist/federation/builder.test.mjs +1 -1
- package/dist/federation/compound-fanout.test.mjs +6 -3
- package/dist/federation/handler-compound-proof.test.mjs +3 -3
- package/dist/federation/handler.test.mjs +4 -4
- package/dist/federation/hashlink-media.test.mjs +2 -2
- package/dist/federation/idempotency.test.mjs +2 -2
- package/dist/federation/inbox-report.test.mjs +5 -5
- package/dist/federation/inbox.test.mjs +1 -1
- package/dist/federation/metrics.test.mjs +1 -1
- package/dist/federation/middleware.test.mjs +465 -32
- package/dist/federation/mod.cjs +1 -1
- package/dist/federation/mod.d.cts +3 -3
- package/dist/federation/mod.d.ts +3 -3
- package/dist/federation/mod.js +1 -1
- package/dist/federation/outgoing-proof.test.mjs +9 -6
- package/dist/federation/portable-actor.test.mjs +3 -3
- package/dist/federation/portable-chain.test.mjs +3 -3
- package/dist/federation/portable-collection.test.mjs +4 -4
- package/dist/federation/portable-delivery.test.mjs +2 -2
- package/dist/federation/portable-gateway-keys.test.mjs +11 -5
- package/dist/federation/portable-inbox.test.mjs +4 -4
- package/dist/federation/portable-parse-uri.test.mjs +1 -1
- package/dist/federation/portable-route-activity.test.mjs +2 -2
- package/dist/federation/portable.test.mjs +3 -3
- package/dist/federation/send.test.mjs +498 -88
- package/dist/federation/tasks/enqueue.test.mjs +1 -1
- package/dist/federation/tasks/tasks.test.mjs +2 -2
- package/dist/federation/temporal.test.mjs +1 -1
- package/dist/federation/webfinger.test.mjs +1 -1
- package/dist/{federation-Dd9IwOEi.cjs → federation-BtPz9sr3.cjs} +240 -102
- package/dist/{http-D7L2pqLT.mjs → http-BSARoDPh.mjs} +204 -106
- package/dist/{http-DLf8QYD6.cjs → http-CeVcKQMZ.cjs} +179 -110
- package/dist/{http-BVrOR6MG.js → http-rH230xCD.js} +178 -109
- package/dist/{inbox-DtEKOr3W.mjs → inbox-BdZenpZQ.mjs} +2 -2
- package/dist/{key-DYxuyd-s.d.cts → key-CyCcut3h.d.ts} +1 -2
- package/dist/{key-C1nv7_jD.d.ts → key-VEL1QqHF.d.cts} +1 -2
- package/dist/{kv-cache-Dkzuqs8B.cjs → kv-cache-BpGIONmd.cjs} +72 -27
- package/dist/{kv-cache-DoZoRS9p.js → kv-cache-CNfNI_95.js} +73 -28
- package/dist/{kv-cache-m3RIr811.mjs → kv-cache-Cxn7pNMx.mjs} +1 -1
- package/dist/{ld-PJLGA2MJ.mjs → ld-DJZrjNuN.mjs} +2 -2
- package/dist/{metrics-CGR9cI-Y.mjs → metrics-DtxsYIkN.mjs} +1 -1
- package/dist/{middleware-BxhBd7pw.js → middleware-DDvck2q9.js} +241 -103
- package/dist/{middleware-ByanhTvb.mjs → middleware-DblGj642.mjs} +82 -42
- package/dist/{middleware-DPI-Jp9w.mjs → middleware-DyEjt33n.mjs} +1 -1
- package/dist/{mod-DEZXwV6J.d.ts → mod-B1Qt5cQQ.d.ts} +2 -9
- package/dist/{mod-Xj5P4s4d.d.ts → mod-B5COx5Wd.d.ts} +1 -1
- package/dist/{mod-CavhAgLw.d.cts → mod-BTxJG7ZH.d.cts} +1 -1
- package/dist/{mod-CtpF2BU5.d.ts → mod-CpyjFA9s.d.ts} +1 -1
- package/dist/{mod-BojP2Bw3.d.cts → mod-makPMVMg.d.cts} +1 -1
- package/dist/{mod-Dw-nPxQh.d.cts → mod-ss0wBUH1.d.cts} +2 -9
- package/dist/mod.cjs +5 -5
- package/dist/mod.d.cts +6 -6
- package/dist/mod.d.ts +6 -6
- package/dist/mod.js +5 -5
- package/dist/nodeinfo/client.test.mjs +337 -19
- package/dist/nodeinfo/handler.test.mjs +1 -1
- package/dist/nodeinfo/mod.cjs +1 -1
- package/dist/nodeinfo/mod.d.cts +1 -1
- package/dist/nodeinfo/mod.d.ts +1 -1
- package/dist/nodeinfo/mod.js +1 -1
- package/dist/otel/exporter.test.mjs +292 -30
- package/dist/otel/mod.cjs +36 -30
- package/dist/otel/mod.d.cts +13 -0
- package/dist/otel/mod.d.ts +13 -0
- package/dist/otel/mod.js +36 -30
- package/dist/{owner-B5c276hH.mjs → owner-2vfqhUJw.mjs} +3 -3
- package/dist/{portable-collection-BMZY9qT-.js → portable-collection-B7AQ_dW7.js} +1 -1
- package/dist/{portable-collection-CR5uwjws.cjs → portable-collection-Cs--KD5A.cjs} +1 -1
- package/dist/{portable-collection-C88tBiy0.mjs → portable-collection-DKJwGO8S.mjs} +2 -2
- package/dist/{portable-key-DxTXUpCK.mjs → portable-key-DXGepvtD.mjs} +1 -1
- package/dist/{proof-DNu-qP0i.mjs → proof-DW0FK6Cp.mjs} +3 -3
- package/dist/{send-CdCifQs4.mjs → send-CqsocpvF.mjs} +174 -76
- package/dist/sig/compound-proof-discovery.test.mjs +1 -1
- package/dist/sig/compound-proof-producer.test.mjs +1 -1
- package/dist/sig/compound-proof-verification.test.mjs +2 -2
- package/dist/sig/compound-proof.test.mjs +2 -2
- package/dist/sig/http.test.mjs +553 -2
- package/dist/sig/key.test.mjs +1 -1
- package/dist/sig/ld.test.mjs +1 -1
- package/dist/sig/mitra-receive-interop.test.mjs +4 -4
- package/dist/sig/mitra-send-interop.test.mjs +3 -3
- package/dist/sig/mod.cjs +2 -2
- package/dist/sig/mod.d.cts +2 -2
- package/dist/sig/mod.d.ts +2 -2
- package/dist/sig/mod.js +2 -2
- package/dist/sig/owner.test.mjs +1 -1
- package/dist/sig/portable-collection.test.mjs +1 -1
- package/dist/sig/portable-interop.test.mjs +3 -3
- package/dist/sig/portable-key.test.mjs +5 -5
- package/dist/sig/proof.test.mjs +4 -4
- package/dist/sig/tootik-request-interop.test.mjs +4 -4
- package/dist/sig/tootik-send-interop.test.mjs +3 -3
- package/dist/sig/verification.test.mjs +3 -3
- package/dist/{temporal-BuMu2bgP.mjs → temporal-Dm2E1-vs.mjs} +1 -1
- package/dist/testing/kv.test.mjs +1 -1
- package/dist/testing/mod.d.mts +26 -0
- package/dist/{types-_S2_MeLF.js → types-DUjZb4i6.js} +112 -63
- package/dist/{types-poIao40f.cjs → types-hKCCjii0.cjs} +111 -62
- package/dist/utils/docloader.test.mjs +344 -36
- package/dist/utils/kv-cache.test.mjs +1 -1
- package/dist/utils/mod.cjs +1 -1
- package/dist/utils/mod.d.cts +1 -1
- package/dist/utils/mod.d.ts +1 -1
- package/dist/utils/mod.js +1 -1
- package/package.json +7 -7
- package/dist/docloader-DQNRDYDb.mjs +0 -91
|
@@ -17,7 +17,7 @@ json_canon = require_rolldown_runtime.__toESM(json_canon, 1);
|
|
|
17
17
|
let _opentelemetry_semantic_conventions = require("@opentelemetry/semantic-conventions");
|
|
18
18
|
//#region deno.json
|
|
19
19
|
var name = "@fedify/fedify";
|
|
20
|
-
var version = "2.4.
|
|
20
|
+
var version = "2.4.6-dev.2628+2a78382f";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region src/sig/portable-key-id.ts
|
|
23
23
|
const COMPATIBLE_KEY_ID_PATH_PATTERN = /^\/\.well-known\/apgateway\/did(?::|%3A)/i;
|
|
@@ -10004,10 +10004,10 @@ async function createRedirectRequest(request, location, body, validateRedirect)
|
|
|
10004
10004
|
cache: request.cache
|
|
10005
10005
|
});
|
|
10006
10006
|
}
|
|
10007
|
-
async function fetchDoubleKnockRequest(request, signedRequest, signal) {
|
|
10007
|
+
async function fetchDoubleKnockRequest(session, request, signedRequest, signal) {
|
|
10008
10008
|
const maxAttempts = request.method === "GET" || request.method === "HEAD" ? 2 : 1;
|
|
10009
10009
|
for (let attempt = 1;; attempt++) try {
|
|
10010
|
-
return await fetch(signedRequest, {
|
|
10010
|
+
return await session.fetch(signedRequest, {
|
|
10011
10011
|
redirect: "manual",
|
|
10012
10012
|
signal
|
|
10013
10013
|
});
|
|
@@ -10058,125 +10058,194 @@ function getAbortReason(signal) {
|
|
|
10058
10058
|
return signal.reason ?? new DOMException("The operation was aborted.", "AbortError");
|
|
10059
10059
|
}
|
|
10060
10060
|
/**
|
|
10061
|
-
* Performs a double-knock request
|
|
10062
|
-
*
|
|
10063
|
-
*
|
|
10061
|
+
* Performs a double-knock request like {@link doubleKnock}, opening a session
|
|
10062
|
+
* for every hop with the given function, and passes the final response to
|
|
10063
|
+
* the given function. The final session is closed after `consume` settles,
|
|
10064
|
+
* so `consume` must read or cancel the response body before it returns.
|
|
10065
|
+
* This is not exported from any entry point.
|
|
10064
10066
|
* @param request The request to send.
|
|
10065
10067
|
* @param identity The identity to use for signing the request.
|
|
10066
10068
|
* @param options The options for double-knock requests.
|
|
10067
|
-
* @
|
|
10068
|
-
*
|
|
10069
|
+
* @param openHop The function to open a session for each hop. The session of
|
|
10070
|
+
* a hop is closed before the next hop is opened.
|
|
10071
|
+
* @param consume The function to consume the final response.
|
|
10072
|
+
* @returns The value returned by `consume`.
|
|
10069
10073
|
*/
|
|
10070
|
-
async function
|
|
10071
|
-
|
|
10074
|
+
async function doubleKnockScoped(request, identity, options, openHop, consume) {
|
|
10075
|
+
const { response, session } = await doubleKnockCore(request, identity, options, openHop);
|
|
10076
|
+
try {
|
|
10077
|
+
return await consume(response);
|
|
10078
|
+
} catch (error) {
|
|
10079
|
+
(0, _logtape_logtape.getLogger)([
|
|
10080
|
+
"fedify",
|
|
10081
|
+
"sig",
|
|
10082
|
+
"http"
|
|
10083
|
+
]).debug("Failed to consume the response from {url}; closing the session: {error}", {
|
|
10084
|
+
url: request.url,
|
|
10085
|
+
error
|
|
10086
|
+
});
|
|
10087
|
+
throw error;
|
|
10088
|
+
} finally {
|
|
10089
|
+
await session.close();
|
|
10090
|
+
}
|
|
10091
|
+
}
|
|
10092
|
+
function isRedirectResponse(response) {
|
|
10093
|
+
return response.status >= 300 && response.status < 400 && response.headers.has("Location");
|
|
10094
|
+
}
|
|
10095
|
+
/**
|
|
10096
|
+
* Starts cancelling the body of a response that is not passed to the caller,
|
|
10097
|
+
* without waiting for it to settle. The cancellation of a branch of a tee
|
|
10098
|
+
* (e.g., a body cloned by a fetch mock) settles only after the other branch
|
|
10099
|
+
* is cancelled too, per the Streams standard, so awaiting it could block
|
|
10100
|
+
* forever. Failures are only logged.
|
|
10101
|
+
*/
|
|
10102
|
+
function cancelResponseBody(response, url) {
|
|
10103
|
+
response.body?.cancel().catch((error) => {
|
|
10104
|
+
(0, _logtape_logtape.getLogger)([
|
|
10105
|
+
"fedify",
|
|
10106
|
+
"sig",
|
|
10107
|
+
"http"
|
|
10108
|
+
]).debug("Failed to cancel the response body from {url}: {error}", {
|
|
10109
|
+
url,
|
|
10110
|
+
error
|
|
10111
|
+
});
|
|
10112
|
+
});
|
|
10072
10113
|
}
|
|
10073
|
-
async function
|
|
10114
|
+
async function doubleKnockCore(request, identity, options, openHop) {
|
|
10074
10115
|
const { specDeterminer, log, tracerProvider, signal } = options;
|
|
10075
10116
|
signal?.throwIfAborted();
|
|
10076
10117
|
const maximumRedirection = options.maxRedirection ?? DEFAULT_MAX_REDIRECTION;
|
|
10077
|
-
visited
|
|
10078
|
-
const origin = new URL(request.url).origin;
|
|
10079
|
-
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
10080
|
-
signal?.throwIfAborted();
|
|
10118
|
+
const visited = /* @__PURE__ */ new Set();
|
|
10081
10119
|
const body = options.body !== void 0 ? options.body : request.method !== "GET" && request.method !== "HEAD" ? await request.clone().arrayBuffer() : null;
|
|
10082
|
-
let
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
|
|
10094
|
-
|
|
10095
|
-
|
|
10096
|
-
|
|
10097
|
-
|
|
10098
|
-
|
|
10099
|
-
|
|
10100
|
-
|
|
10101
|
-
|
|
10102
|
-
|
|
10103
|
-
|
|
10104
|
-
|
|
10105
|
-
|
|
10106
|
-
|
|
10107
|
-
|
|
10108
|
-
|
|
10109
|
-
|
|
10110
|
-
|
|
10111
|
-
|
|
10112
|
-
|
|
10113
|
-
|
|
10114
|
-
|
|
10115
|
-
|
|
10116
|
-
|
|
10117
|
-
|
|
10118
|
-
|
|
10119
|
-
|
|
10120
|
-
|
|
10121
|
-
|
|
10122
|
-
|
|
10123
|
-
|
|
10124
|
-
|
|
10120
|
+
let session = await openHop(request.url);
|
|
10121
|
+
try {
|
|
10122
|
+
for (let redirected = 0;; redirected++) {
|
|
10123
|
+
visited.add(request.url);
|
|
10124
|
+
const origin = new URL(request.url).origin;
|
|
10125
|
+
const firstTrySpec = specDeterminer == null ? "rfc9421" : await specDeterminer.determineSpec(origin);
|
|
10126
|
+
signal?.throwIfAborted();
|
|
10127
|
+
let signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
|
10128
|
+
spec: firstTrySpec,
|
|
10129
|
+
tracerProvider,
|
|
10130
|
+
body
|
|
10131
|
+
});
|
|
10132
|
+
signal?.throwIfAborted();
|
|
10133
|
+
log?.(signedRequest);
|
|
10134
|
+
let response = await fetchDoubleKnockRequest(session, request, signedRequest, signal);
|
|
10135
|
+
const firstRedirected = isRedirectResponse(response);
|
|
10136
|
+
if (!firstRedirected && (response.status === 400 || response.status === 401 || response.status > 401)) {
|
|
10137
|
+
const logger = (0, _logtape_logtape.getLogger)([
|
|
10138
|
+
"fedify",
|
|
10139
|
+
"sig",
|
|
10140
|
+
"http"
|
|
10141
|
+
]);
|
|
10142
|
+
const acceptSigHeader = response.headers.get("Accept-Signature");
|
|
10143
|
+
if (acceptSigHeader != null) {
|
|
10144
|
+
const entries = validateAcceptSignature(parseAcceptSignature(acceptSigHeader));
|
|
10145
|
+
const localKeyId = identity.keyId.href;
|
|
10146
|
+
const localAlg = "rsa-v1_5-sha256";
|
|
10147
|
+
let fulfilled = false;
|
|
10148
|
+
let challengeRequest;
|
|
10149
|
+
for (const entry of entries) {
|
|
10150
|
+
signal?.throwIfAborted();
|
|
10151
|
+
const rfc9421 = fulfillAcceptSignature(entry, localKeyId, localAlg);
|
|
10152
|
+
if (rfc9421 == null) continue;
|
|
10153
|
+
logger.debug("Received Accept-Signature challenge; accumulating label {label} and components {components}.", {
|
|
10154
|
+
label: rfc9421.label,
|
|
10155
|
+
components: rfc9421.components
|
|
10156
|
+
});
|
|
10157
|
+
try {
|
|
10158
|
+
challengeRequest = await signRequest(challengeRequest ?? request, identity.privateKey, identity.keyId, {
|
|
10159
|
+
spec: "rfc9421",
|
|
10160
|
+
tracerProvider,
|
|
10161
|
+
body,
|
|
10162
|
+
rfc9421
|
|
10163
|
+
});
|
|
10164
|
+
fulfilled = true;
|
|
10165
|
+
} catch (error) {
|
|
10166
|
+
logger.debug("Failed to fulfill Accept-Signature challenge entry {label}: {error}", {
|
|
10167
|
+
label: entry.label,
|
|
10168
|
+
error
|
|
10169
|
+
});
|
|
10170
|
+
}
|
|
10171
|
+
}
|
|
10172
|
+
if (fulfilled && challengeRequest != null) {
|
|
10173
|
+
signal?.throwIfAborted();
|
|
10174
|
+
cancelResponseBody(response, request.url);
|
|
10175
|
+
signedRequest = challengeRequest;
|
|
10176
|
+
log?.(signedRequest);
|
|
10177
|
+
response = await session.fetch(signedRequest, {
|
|
10178
|
+
redirect: "manual",
|
|
10179
|
+
signal
|
|
10180
|
+
});
|
|
10181
|
+
}
|
|
10182
|
+
if (fulfilled && !isRedirectResponse(response)) {
|
|
10183
|
+
if (response.status < 300) {
|
|
10184
|
+
await specDeterminer?.rememberSpec(origin, "rfc9421");
|
|
10185
|
+
return {
|
|
10186
|
+
response,
|
|
10187
|
+
session
|
|
10188
|
+
};
|
|
10189
|
+
}
|
|
10190
|
+
if (response.status !== 400 && response.status !== 401) return {
|
|
10191
|
+
response,
|
|
10192
|
+
session
|
|
10193
|
+
};
|
|
10194
|
+
}
|
|
10195
|
+
}
|
|
10196
|
+
if (!isRedirectResponse(response)) {
|
|
10197
|
+
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
10198
|
+
(0, _logtape_logtape.getLogger)([
|
|
10199
|
+
"fedify",
|
|
10200
|
+
"sig",
|
|
10201
|
+
"http"
|
|
10202
|
+
]).debug("Failed to verify with the spec {spec} ({status} {statusText}); retrying with spec {secondSpec}... (double-knocking)", {
|
|
10203
|
+
spec: firstTrySpec,
|
|
10204
|
+
secondSpec: spec,
|
|
10205
|
+
status: response.status,
|
|
10206
|
+
statusText: response.statusText
|
|
10125
10207
|
});
|
|
10126
|
-
|
|
10127
|
-
|
|
10128
|
-
|
|
10129
|
-
|
|
10130
|
-
|
|
10208
|
+
cancelResponseBody(response, request.url);
|
|
10209
|
+
signal?.throwIfAborted();
|
|
10210
|
+
signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
|
10211
|
+
spec,
|
|
10212
|
+
tracerProvider,
|
|
10213
|
+
body
|
|
10131
10214
|
});
|
|
10215
|
+
signal?.throwIfAborted();
|
|
10216
|
+
log?.(signedRequest);
|
|
10217
|
+
response = await fetchDoubleKnockRequest(session, request, signedRequest, signal);
|
|
10218
|
+
if (!isRedirectResponse(response) && response.status !== 400 && response.status !== 401) await specDeterminer?.rememberSpec(origin, spec);
|
|
10132
10219
|
}
|
|
10133
|
-
}
|
|
10134
|
-
if (
|
|
10135
|
-
|
|
10136
|
-
|
|
10137
|
-
|
|
10138
|
-
|
|
10139
|
-
|
|
10140
|
-
signal
|
|
10141
|
-
});
|
|
10142
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) return doubleKnock(await createRedirectRequest(request, response.headers.get("Location"), body, options.validateRedirect), identity, {
|
|
10143
|
-
...options,
|
|
10144
|
-
body
|
|
10145
|
-
});
|
|
10146
|
-
}
|
|
10147
|
-
if (fulfilled && response.status < 300) {
|
|
10148
|
-
await specDeterminer?.rememberSpec(origin, "rfc9421");
|
|
10149
|
-
return response;
|
|
10150
|
-
}
|
|
10151
|
-
if (fulfilled && response.status !== 400 && response.status !== 401) return response;
|
|
10152
|
-
}
|
|
10153
|
-
const spec = firstTrySpec === "draft-cavage-http-signatures-12" ? "rfc9421" : "draft-cavage-http-signatures-12";
|
|
10154
|
-
logger.debug("Failed to verify with the spec {spec} ({status} {statusText}); retrying with spec {secondSpec}... (double-knocking)", {
|
|
10155
|
-
spec: firstTrySpec,
|
|
10156
|
-
secondSpec: spec,
|
|
10157
|
-
status: response.status,
|
|
10158
|
-
statusText: response.statusText
|
|
10159
|
-
});
|
|
10160
|
-
signal?.throwIfAborted();
|
|
10161
|
-
signedRequest = await signRequest(request, identity.privateKey, identity.keyId, {
|
|
10162
|
-
spec,
|
|
10163
|
-
tracerProvider,
|
|
10164
|
-
body
|
|
10165
|
-
});
|
|
10166
|
-
signal?.throwIfAborted();
|
|
10167
|
-
log?.(signedRequest);
|
|
10168
|
-
response = await fetchDoubleKnockRequest(request, signedRequest, signal);
|
|
10169
|
-
if (response.status >= 300 && response.status < 400 && response.headers.has("Location")) {
|
|
10220
|
+
} else if (!firstRedirected) await specDeterminer?.rememberSpec(origin, firstTrySpec);
|
|
10221
|
+
if (!isRedirectResponse(response)) return {
|
|
10222
|
+
response,
|
|
10223
|
+
session
|
|
10224
|
+
};
|
|
10225
|
+
cancelResponseBody(response, request.url);
|
|
10226
|
+
await session.close();
|
|
10170
10227
|
if (redirected >= maximumRedirection) throw new _fedify_vocab_runtime.FetchError(request.url, `Too many redirections (${redirected + 1})`);
|
|
10171
|
-
const
|
|
10228
|
+
const location = response.headers.get("Location");
|
|
10229
|
+
const redirectRequest = await createRedirectRequest(request, location, body, options.validateRedirect);
|
|
10172
10230
|
if (visited.has(redirectRequest.url)) throw new _fedify_vocab_runtime.FetchError(request.url, `Redirect loop detected: ${redirectRequest.url}`);
|
|
10173
|
-
|
|
10174
|
-
|
|
10175
|
-
|
|
10176
|
-
|
|
10177
|
-
|
|
10178
|
-
|
|
10179
|
-
|
|
10231
|
+
request = redirectRequest;
|
|
10232
|
+
session = await openHop(request.url);
|
|
10233
|
+
}
|
|
10234
|
+
} catch (error) {
|
|
10235
|
+
try {
|
|
10236
|
+
await session.close();
|
|
10237
|
+
} catch (closeError) {
|
|
10238
|
+
(0, _logtape_logtape.getLogger)([
|
|
10239
|
+
"fedify",
|
|
10240
|
+
"sig",
|
|
10241
|
+
"http"
|
|
10242
|
+
]).debug("Failed to close the session for {url}: {error}", {
|
|
10243
|
+
url: request.url,
|
|
10244
|
+
error: closeError
|
|
10245
|
+
});
|
|
10246
|
+
}
|
|
10247
|
+
throw error;
|
|
10248
|
+
}
|
|
10180
10249
|
}
|
|
10181
10250
|
/**
|
|
10182
10251
|
* Performs a timing-safe equality comparison between two `Uint8Array` values.
|
|
@@ -10272,10 +10341,10 @@ Object.defineProperty(exports, "detachSignature", {
|
|
|
10272
10341
|
return detachSignature;
|
|
10273
10342
|
}
|
|
10274
10343
|
});
|
|
10275
|
-
Object.defineProperty(exports, "
|
|
10344
|
+
Object.defineProperty(exports, "doubleKnockScoped", {
|
|
10276
10345
|
enumerable: true,
|
|
10277
10346
|
get: function() {
|
|
10278
|
-
return
|
|
10347
|
+
return doubleKnockScoped;
|
|
10279
10348
|
}
|
|
10280
10349
|
});
|
|
10281
10350
|
Object.defineProperty(exports, "exportJwk", {
|