@fedify/relay 2.0.29-dev.2139 → 2.0.29-dev.2143

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.
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-DNrCzWDC.js";
4
+ import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-CyJoorlE.js";
5
5
  import { MemoryKvStore, signRequest } from "@fedify/fedify";
6
6
  import { createRelay } from "@fedify/relay";
7
7
  import { Accept, Announce, Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
@@ -1,7 +1,7 @@
1
1
  import "@js-temporal/polyfill";
2
2
  import "urlpattern-polyfill";
3
3
  globalThis.addEventListener = () => {};
4
- import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-DNrCzWDC.js";
4
+ import { n as exportSpki, r as getDocumentLoader, t as isRelayFollowerData } from "./types-CyJoorlE.js";
5
5
  import { MemoryKvStore, signRequest } from "@fedify/fedify";
6
6
  import { createRelay } from "@fedify/relay";
7
7
  import { Create, Delete, Follow, Move, Note, Person, Undo, Update } from "@fedify/vocab";
@@ -25670,7 +25670,7 @@ const preloadedContexts = {
25670
25670
  "https://purl.archive.org/miscellany": miscellany_default
25671
25671
  };
25672
25672
  var name = "@fedify/vocab-runtime";
25673
- var version = "2.0.29-dev.2139+7e5d091d";
25673
+ var version = "2.0.29-dev.2143+bbbfea55";
25674
25674
  /**
25675
25675
  * Error thrown when fetching a JSON-LD document failed.
25676
25676
  */
@@ -26288,6 +26288,8 @@ async function getRemoteDocument(url, response, fetch) {
26288
26288
  }
26289
26289
  /**
26290
26290
  * Creates a JSON-LD document loader that utilizes the browser's `fetch` API.
26291
+ * At most 20 HTTP redirects and alternate document links are followed in total
26292
+ * per call. Revisiting a URL within that chain throws a {@link FetchError}.
26291
26293
  *
26292
26294
  * The created loader preloads the below frequently used contexts by default
26293
26295
  * (unless `options.skipPreloadedContexts` is set to `true`):
@@ -26364,7 +26366,12 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
26364
26366
  }
26365
26367
  return await load(redirectUrl, options, redirected + 1, visited);
26366
26368
  }
26367
- const result = await getRemoteDocument(currentUrl, response, load);
26369
+ const result = await getRemoteDocument(currentUrl, response, async (alternateUrl) => {
26370
+ options?.signal?.throwIfAborted();
26371
+ if (redirected >= DEFAULT_MAX_REDIRECTION) throw new FetchError(currentUrl, `Too many redirections (${redirected + 1})`);
26372
+ if (visited.has(alternateUrl)) throw new FetchError(currentUrl, `Redirect loop detected: ${alternateUrl}`);
26373
+ return await load(alternateUrl, options, redirected + 1, visited);
26374
+ });
26368
26375
  span.setAttribute("docloader.document_url", result.documentUrl);
26369
26376
  if (result.contextUrl != null) span.setAttribute("docloader.context_url", result.contextUrl);
26370
26377
  return result;
@@ -26380,7 +26387,7 @@ function getDocumentLoader({ allowPrivateAddress, skipPreloadedContexts, userAge
26380
26387
  }
26381
26388
  });
26382
26389
  }
26383
- return load;
26390
+ return (url, options) => load(url, options);
26384
26391
  }
26385
26392
  function validateCryptoKey(key, type) {
26386
26393
  if (type != null && key.type !== type) throw new TypeError(`The key is not a ${type} key.`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/relay",
3
- "version": "2.0.29-dev.2139+7e5d091d",
3
+ "version": "2.0.29-dev.2143+bbbfea55",
4
4
  "description": "ActivityPub relay support for Fedify",
5
5
  "keywords": [
6
6
  "Fedify",
@@ -50,14 +50,14 @@
50
50
  "dependencies": {
51
51
  "@js-temporal/polyfill": "^0.5.1",
52
52
  "@logtape/logtape": "^2.0.0",
53
- "@fedify/vocab": "2.0.29-dev.2139+7e5d091d",
54
- "@fedify/fedify": "^2.0.29-dev.2139+7e5d091d"
53
+ "@fedify/fedify": "^2.0.29-dev.2143+bbbfea55",
54
+ "@fedify/vocab": "2.0.29-dev.2143+bbbfea55"
55
55
  },
56
56
  "devDependencies": {
57
57
  "tsdown": "^0.21.6",
58
58
  "typescript": "^6.0.0",
59
59
  "urlpattern-polyfill": "^10.1.0",
60
- "@fedify/vocab-runtime": "^2.0.29-dev.2139+7e5d091d"
60
+ "@fedify/vocab-runtime": "^2.0.29-dev.2143+bbbfea55"
61
61
  },
62
62
  "scripts": {
63
63
  "build:self": "tsdown",