@fedify/fedify 1.0.5 → 1.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (22) hide show
  1. package/CHANGES.md +45 -1
  2. package/esm/federation/handler.js +1 -1
  3. package/esm/runtime/contexts.js +3367 -0
  4. package/esm/runtime/docloader.js +5 -4
  5. package/package.json +1 -1
  6. package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/common.d.ts.map +1 -1
  7. package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/encoding.d.ts.map +1 -1
  8. package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/language.d.ts.map +1 -1
  9. package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/media_type.d.ts.map +1 -1
  10. package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/negotiation.d.ts.map +1 -1
  11. package/types/runtime/contexts.d.ts.map +1 -1
  12. package/types/runtime/docloader.d.ts.map +1 -1
  13. /package/esm/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/common.js +0 -0
  14. /package/esm/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/encoding.js +0 -0
  15. /package/esm/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/language.js +0 -0
  16. /package/esm/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/media_type.js +0 -0
  17. /package/esm/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/negotiation.js +0 -0
  18. /package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/common.d.ts +0 -0
  19. /package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/encoding.d.ts +0 -0
  20. /package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/language.d.ts +0 -0
  21. /package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/_negotiation/media_type.d.ts +0 -0
  22. /package/types/deps/jsr.io/@std/http/{1.0.8 → 1.0.9}/negotiation.d.ts +0 -0
@@ -74,13 +74,14 @@ async function getRemoteDocument(url, response, fetch) {
74
74
  else {
75
75
  const entries = link.getByRel("alternate");
76
76
  for (const [uri, params] of entries) {
77
+ const altUri = new URL(uri, docUrl);
77
78
  if ("type" in params &&
78
79
  (params.type === "application/activity+json" ||
79
80
  params.type === "application/ld+json" ||
80
81
  params.type.startsWith("application/ld+json;")) &&
81
- new URL(uri).href !== docUrl.href) {
82
- logger.debug("Found alternate document: {alternateUrl} from {url}", { alternateUrl: uri, url: documentUrl });
83
- return await fetch(uri);
82
+ altUri.href !== docUrl.href) {
83
+ logger.debug("Found alternate document: {alternateUrl} from {url}", { alternateUrl: altUri.href, url: documentUrl });
84
+ return await fetch(altUri.href);
84
85
  }
85
86
  }
86
87
  }
@@ -170,7 +171,7 @@ export async function fetchDocumentLoader(url, allowPrivateAddress = false) {
170
171
  // Follow redirects manually to get the final URL:
171
172
  if (response.status >= 300 && response.status < 400 &&
172
173
  response.headers.has("Location")) {
173
- return fetchDocumentLoader(response.headers.get("Location"));
174
+ return fetchDocumentLoader(response.headers.get("Location"), allowPrivateAddress);
174
175
  }
175
176
  return getRemoteDocument(url, response, (url) => fetchDocumentLoader(url, allowPrivateAddress));
176
177
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "1.0.5",
3
+ "version": "1.0.7",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -1 +1 @@
1
- {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.8/_negotiation/common.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,MAAM,CAQnE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAEpD"}
1
+ {"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.9/_negotiation/common.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,MAAM,WAAW,WAAW;IAC1B,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACtB,CAAC,EAAE,MAAM,CAAC;IACV,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,CAAC,EAAE,WAAW,EAAE,CAAC,EAAE,WAAW,GAAG,MAAM,CAQnE;AAED,wBAAgB,SAAS,CAAC,IAAI,EAAE,WAAW,GAAG,OAAO,CAEpD"}
@@ -1 +1 @@
1
- {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.8/_negotiation/encoding.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA8GH;;qCAEqC;AACrC,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CAkBV"}
1
+ {"version":3,"file":"encoding.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.9/_negotiation/encoding.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AA8GH;;qCAEqC;AACrC,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CAkBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.8/_negotiation/language.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAkGH,wBAAgB,kBAAkB,CAChC,MAAM,SAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CAiBV"}
1
+ {"version":3,"file":"language.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.9/_negotiation/language.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAkGH,wBAAgB,kBAAkB,CAChC,MAAM,SAAM,EACZ,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CAiBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"media_type.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.8/_negotiation/media_type.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAiJH,wBAAgB,mBAAmB,CACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CAkBV"}
1
+ {"version":3,"file":"media_type.d.ts","sourceRoot":"","sources":["../../../../../../../src/deps/jsr.io/@std/http/1.0.9/_negotiation/media_type.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAiJH,wBAAgB,mBAAmB,CACjC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,GAClB,MAAM,EAAE,CAkBV"}
@@ -1 +1 @@
1
- {"version":3,"file":"negotiation.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/http/1.0.8/negotiation.ts"],"names":[],"mappings":";AAcA;;;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AsBG;AACH,wBAAgB,OAAO,CACrB,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EACjC,GAAG,KAAK,EAAE,MAAM,EAAE,GACjB,MAAM,GAAG,SAAS,CAAC;AAatB;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,MAAM,EAAE,CAAC;AAC9E;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EACjC,GAAG,SAAS,EAAE,MAAM,EAAE,GACrB,MAAM,GAAG,SAAS,CAAC;AAetB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,GAAG,MAAM,EAAE,CAAC;AAC9E;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,gBAAgB,CAC9B,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,SAAS,CAAC,EACjC,GAAG,KAAK,EAAE,MAAM,EAAE,GACjB,MAAM,GAAG,SAAS,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/runtime/contexts.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAwxB9C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
1
+ {"version":3,"file":"contexts.d.ts","sourceRoot":"","sources":["../../src/runtime/contexts.ts"],"names":[],"mappings":"AAIA,QAAA,MAAM,iBAAiB,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAikI9C,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"docloader.d.ts","sourceRoot":"","sources":["../../src/runtime/doc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