ipfs / helia-verified-fetch

A fetch-like API for obtaining verified & trustless IPFS CIDs on the web
https://npmjs.com/package/@helia/verified-fetch
Other
19 stars 5 forks source link

feat: support redirects for UnixFS directories #5

Closed achingbrain closed 8 months ago

achingbrain commented 8 months ago

Adds support for simulating redirects for UnixFS directories.

We're somewhat in uncharted water here because window.fetch does this transparently unless you specify a redirect option, none of which actually allow you to manually follow a redirect.

The states we can be in are:

  1. URL: ipfs://QmFoo/dir/
    • Happy path
    • 200 response
    • response.redirected = false
    • response.url = 'ipfs://QmFoo/dir'

2: URL: ipfs://QmFoo/dir, redirect: 'follow'

3: URL: ipfs://QmFoo/dir, redirect: 'error'

4: URL: ipfs://QmFoo/dir, redirect: 'manual'

Number 4 is the furthest from the fetch spec but to follow the spec would make it impossible to actually follow a redirect.

Refs: https://github.com/ipfs-shipyard/helia-service-worker-gateway/issues/62

Change checklist

github-actions[bot] commented 8 months ago

:tada: This PR is included in version 1.1.0 :tada:

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

github-actions[bot] commented 8 months ago

:tada: This PR is included in version 1.3.0 :tada:

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

github-actions[bot] commented 6 months ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on npm package (@latest dist-tag)

Your semantic-release bot :package::rocket:

github-actions[bot] commented 1 month ago

:tada: This PR is included in version 1.0.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: