@helia/verified-fetch 2.3.0 → 2.4.0
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 +8 -0
- package/dist/index.min.js +28 -31
- package/dist/src/index.d.ts +22 -11
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +9 -0
- package/dist/src/index.js.map +1 -1
- package/dist/src/types.d.ts +17 -0
- package/dist/src/types.d.ts.map +1 -1
- package/dist/src/utils/parse-resource.d.ts +2 -1
- package/dist/src/utils/parse-resource.d.ts.map +1 -1
- package/dist/src/utils/parse-resource.js +4 -3
- package/dist/src/utils/parse-resource.js.map +1 -1
- package/dist/src/utils/parse-url-string.d.ts +8 -3
- package/dist/src/utils/parse-url-string.d.ts.map +1 -1
- package/dist/src/utils/parse-url-string.js +30 -4
- package/dist/src/utils/parse-url-string.js.map +1 -1
- package/dist/src/utils/server-timing.d.ts +13 -0
- package/dist/src/utils/server-timing.d.ts.map +1 -0
- package/dist/src/utils/server-timing.js +19 -0
- package/dist/src/utils/server-timing.js.map +1 -0
- package/dist/src/utils/set-content-type.d.ts +12 -0
- package/dist/src/utils/set-content-type.d.ts.map +1 -0
- package/dist/src/utils/set-content-type.js +28 -0
- package/dist/src/utils/set-content-type.js.map +1 -0
- package/dist/src/utils/type-guards.d.ts +2 -0
- package/dist/src/utils/type-guards.d.ts.map +1 -0
- package/dist/src/utils/type-guards.js +4 -0
- package/dist/src/utils/type-guards.js.map +1 -0
- package/dist/src/utils/walk-path.d.ts +0 -1
- package/dist/src/utils/walk-path.d.ts.map +1 -1
- package/dist/src/utils/walk-path.js +1 -1
- package/dist/src/utils/walk-path.js.map +1 -1
- package/dist/src/verified-fetch.d.ts +9 -1
- package/dist/src/verified-fetch.d.ts.map +1 -1
- package/dist/src/verified-fetch.js +50 -46
- package/dist/src/verified-fetch.js.map +1 -1
- package/dist/typedoc-urls.json +0 -1
- package/package.json +2 -2
- package/src/index.ts +24 -11
- package/src/types.ts +19 -0
- package/src/utils/parse-resource.ts +5 -4
- package/src/utils/parse-url-string.ts +38 -7
- package/src/utils/server-timing.ts +37 -0
- package/src/utils/set-content-type.ts +38 -0
- package/src/utils/type-guards.ts +3 -0
- package/src/utils/walk-path.ts +1 -1
- package/src/verified-fetch.ts +59 -51
package/README.md
CHANGED
|
@@ -635,6 +635,14 @@ Some known header specifications:
|
|
|
635
635
|
- <https://specs.ipfs.tech/http-gateways/trustless-gateway/#response-headers>
|
|
636
636
|
- <https://specs.ipfs.tech/http-gateways/subdomain-gateway/#response-headers>
|
|
637
637
|
|
|
638
|
+
#### Server Timing headers
|
|
639
|
+
|
|
640
|
+
By default, we do not include [Server Timing](https://developer.mozilla.org/en-US/docs/Web/API/Performance_API/Server_timing) headers in responses. If you want to include them, you can pass an
|
|
641
|
+
`withServerTiming` option to the `createVerifiedFetch` function to include them in all future responses. You can
|
|
642
|
+
also pass the `withServerTiming` option to each fetch call to include them only for that specific response.
|
|
643
|
+
|
|
644
|
+
See PR where this was added, <https://github.com/ipfs/helia-verified-fetch/pull/164>, for more information.
|
|
645
|
+
|
|
638
646
|
### Possible Scenarios that could cause confusion
|
|
639
647
|
|
|
640
648
|
#### Attempting to fetch the CID for content that does not make sense
|