@fedify/fedify 0.15.5 → 0.15.6

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. package/CHANGES.md +11 -0
  2. package/esm/runtime/docloader.js +6 -5
  3. package/esm/runtime/key.js +1 -1
  4. package/esm/sig/http.js +1 -1
  5. package/package.json +1 -1
  6. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/concat.d.ts.map +1 -1
  7. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/copy.d.ts.map +1 -1
  8. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/ends_with.d.ts.map +1 -1
  9. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/equals.d.ts.map +1 -1
  10. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/includes_needle.d.ts.map +1 -1
  11. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/index_of_needle.d.ts.map +1 -1
  12. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/last_index_of_needle.d.ts.map +1 -1
  13. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/mod.d.ts.map +1 -1
  14. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/repeat.d.ts.map +1 -1
  15. package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/starts_with.d.ts.map +1 -1
  16. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/concat.js +0 -0
  17. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/copy.js +0 -0
  18. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/ends_with.js +0 -0
  19. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/equals.js +0 -0
  20. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/includes_needle.js +0 -0
  21. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/index_of_needle.js +0 -0
  22. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/last_index_of_needle.js +0 -0
  23. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/mod.js +0 -0
  24. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/repeat.js +0 -0
  25. /package/esm/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/starts_with.js +0 -0
  26. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/concat.d.ts +0 -0
  27. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/copy.d.ts +0 -0
  28. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/ends_with.d.ts +0 -0
  29. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/equals.d.ts +0 -0
  30. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/includes_needle.d.ts +0 -0
  31. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/index_of_needle.d.ts +0 -0
  32. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/last_index_of_needle.d.ts +0 -0
  33. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/mod.d.ts +0 -0
  34. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/repeat.d.ts +0 -0
  35. /package/types/deps/jsr.io/@std/bytes/{1.0.2 → 1.0.3}/starts_with.d.ts +0 -0
package/CHANGES.md CHANGED
@@ -3,6 +3,17 @@
3
3
  Fedify changelog
4
4
  ================
5
5
 
6
+ Version 0.15.6
7
+ --------------
8
+
9
+ Released on November 12, 2024.
10
+
11
+ - Fixed a bug where default document loaders had thrown a `TypeError`
12
+ with a message <q>Body is unusable: Body has already been read</q> or
13
+ <q>Body already consumed</q> when the content type of the response was
14
+ an HTML document and there's no link to a JSON-LD document.
15
+
16
+
6
17
  Version 0.15.5
7
18
  --------------
8
19
 
@@ -86,6 +86,7 @@ async function getRemoteDocument(url, response, fetch) {
86
86
  }
87
87
  }
88
88
  }
89
+ let document;
89
90
  if (!jsonLd &&
90
91
  (contentType === "text/html" || contentType?.startsWith("text/html;") ||
91
92
  contentType === "application/xhtml+xml" ||
@@ -113,17 +114,17 @@ async function getRemoteDocument(url, response, fetch) {
113
114
  return await fetch(new URL(attribs.href, docUrl).href);
114
115
  }
115
116
  }
117
+ document = JSON.parse(html);
118
+ }
119
+ else {
120
+ document = await response.json();
116
121
  }
117
122
  logger.debug("Fetched document: {status} {url} {headers}", {
118
123
  status: response.status,
119
124
  url: documentUrl,
120
125
  headers: Object.fromEntries(response.headers.entries()),
121
126
  });
122
- return {
123
- contextUrl,
124
- document: await response.json(),
125
- documentUrl,
126
- };
127
+ return { contextUrl, document, documentUrl };
127
128
  }
128
129
  /**
129
130
  * A JSON-LD document loader that utilizes the browser's `fetch` API.
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { createPublicKey } from "node:crypto";
3
- import { concat } from "../deps/jsr.io/@std/bytes/1.0.2/concat.js";
3
+ import { concat } from "../deps/jsr.io/@std/bytes/1.0.3/concat.js";
4
4
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.3/base64.js";
5
5
  import { decodeBase64Url } from "../deps/jsr.io/@std/encoding/0.224.3/base64url.js";
6
6
  import { decodeHex } from "../deps/jsr.io/@std/encoding/0.224.3/hex.js";
package/esm/sig/http.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import * as dntShim from "../_dnt.shims.js";
2
2
  import { getLogger } from "@logtape/logtape";
3
- import { equals } from "../deps/jsr.io/@std/bytes/1.0.2/mod.js";
3
+ import { equals } from "../deps/jsr.io/@std/bytes/1.0.3/mod.js";
4
4
  import { decodeBase64, encodeBase64 } from "../deps/jsr.io/@std/encoding/0.224.3/base64.js";
5
5
  import { CryptographicKey } from "../vocab/vocab.js";
6
6
  import { fetchKey, validateCryptoKey } from "./key.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fedify/fedify",
3
- "version": "0.15.5",
3
+ "version": "0.15.6",
4
4
  "description": "An ActivityPub server framework",
5
5
  "keywords": [
6
6
  "ActivityPub",
@@ -1 +1 @@
1
- {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/concat.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAaxD"}
1
+ {"version":3,"file":"concat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/concat.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,MAAM,CAAC,OAAO,EAAE,UAAU,EAAE,GAAG,UAAU,CAaxD"}
@@ -1 +1 @@
1
- {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/copy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,MAAM,CAQzE"}
1
+ {"version":3,"file":"copy.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/copy.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAgB,IAAI,CAAC,GAAG,EAAE,UAAU,EAAE,GAAG,EAAE,UAAU,EAAE,MAAM,SAAI,GAAG,MAAM,CAQzE"}
@@ -1 +1 @@
1
- {"version":3,"file":"ends_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/ends_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAWxE"}
1
+ {"version":3,"file":"ends_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/ends_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,QAAQ,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAWxE"}
@@ -1 +1 @@
1
- {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/equals.ts"],"names":[],"mappings":"AA6DA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAQ5D"}
1
+ {"version":3,"file":"equals.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/equals.ts"],"names":[],"mappings":"AA6DA;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAQ5D"}
@@ -1 +1 @@
1
- {"version":3,"file":"includes_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/includes_needle.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,OAAO,CAET"}
1
+ {"version":3,"file":"includes_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/includes_needle.ts"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,wBAAgB,cAAc,CAC5B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,OAAO,CAET"}
@@ -1 +1 @@
1
- {"version":3,"file":"index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,MAAM,CAqBR"}
1
+ {"version":3,"file":"index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0CG;AACH,wBAAgB,aAAa,CAC3B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,SAAI,GACR,MAAM,CAqBR"}
@@ -1 +1 @@
1
- {"version":3,"file":"last_index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/last_index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,GAAE,MAA0B,GAChC,MAAM,CAuBR"}
1
+ {"version":3,"file":"last_index_of_needle.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/last_index_of_needle.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,wBAAgB,iBAAiB,CAC/B,MAAM,EAAE,UAAU,EAClB,MAAM,EAAE,UAAU,EAClB,KAAK,GAAE,MAA0B,GAChC,MAAM,CAuBR"}
@@ -1 +1 @@
1
- {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
1
+ {"version":3,"file":"mod.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/mod.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,cAAc,aAAa,CAAC;AAC5B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,aAAa,CAAC;AAC5B,cAAc,kBAAkB,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/repeat.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAapE"}
1
+ {"version":3,"file":"repeat.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/repeat.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,MAAM,CAAC,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,UAAU,CAapE"}
@@ -1 +1 @@
1
- {"version":3,"file":"starts_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.2/starts_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAS1E"}
1
+ {"version":3,"file":"starts_with.d.ts","sourceRoot":"","sources":["../../../../../../src/deps/jsr.io/@std/bytes/1.0.3/starts_with.ts"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,UAAU,CAAC,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,UAAU,GAAG,OAAO,CAS1E"}