@helia/verified-fetch 2.6.15 → 2.6.16
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 -3
- package/dist/index.min.js.map +3 -3
- package/dist/src/index.d.ts +7 -7
- package/dist/src/index.js +3 -3
- package/dist/src/plugins/plugin-handle-raw.js +2 -2
- package/dist/src/plugins/plugin-handle-raw.js.map +1 -1
- package/dist/src/utils/handle-redirects.js +3 -3
- package/dist/src/utils/handle-redirects.js.map +1 -1
- package/dist/src/utils/parse-url-string.js +2 -2
- package/dist/src/utils/parse-url-string.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +7 -7
- package/src/plugins/plugin-handle-raw.ts +2 -2
- package/src/utils/handle-redirects.ts +3 -3
- package/src/utils/parse-url-string.ts +2 -2
package/README.md
CHANGED
|
@@ -399,7 +399,7 @@ console.info(obj.buf) // Uint8Array(5) [ 0, 1, 2, 3, 4 ]
|
|
|
399
399
|
|
|
400
400
|
[DAG-CBOR](https://ipld.io/docs/codecs/known/dag-cbor/) uses the [Concise Binary Object Representation](https://cbor.io/) format for serialization instead of JSON.
|
|
401
401
|
|
|
402
|
-
This supports more
|
|
402
|
+
This supports more data types in a safer way than JSON and is smaller on the wire to boot so is usually preferable to JSON or DAG-JSON.
|
|
403
403
|
|
|
404
404
|
##### Content-Type
|
|
405
405
|
|
|
@@ -479,7 +479,7 @@ const res = await verifiedFetch('ipfs://bafyfoo/path/to/dir')
|
|
|
479
479
|
console.info(res.url) // ipfs://bafyfoo/path/to/dir/
|
|
480
480
|
```
|
|
481
481
|
|
|
482
|
-
It's possible to prevent this
|
|
482
|
+
It's possible to prevent this behavior and/or handle a redirect manually
|
|
483
483
|
through use of the [redirect](https://developer.mozilla.org/en-US/docs/Web/API/fetch#redirect)
|
|
484
484
|
option.
|
|
485
485
|
|
|
@@ -658,7 +658,7 @@ Known Errors that can be thrown:
|
|
|
658
658
|
3. `TypeError` - If the options argument is passed and is malformed.
|
|
659
659
|
4. `AbortError` - If the content request is aborted due to user aborting provided AbortSignal. Note that this is a `AbortError` from `@libp2p/interface` and not the standard `AbortError` from the Fetch API.
|
|
660
660
|
|
|
661
|
-
##
|
|
661
|
+
## Extensibility
|
|
662
662
|
|
|
663
663
|
Verified‑fetch can now be extended to alter how it handles requests by using plugins.
|
|
664
664
|
Plugins are classes that extend the `BasePlugin` class and implement the `VerifiedFetchPlugin`
|