Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjust logic for IPFS redirections #21505

Closed
spylogsster opened this issue Mar 7, 2022 · 3 comments
Closed

Adjust logic for IPFS redirections #21505

spylogsster opened this issue Mar 7, 2022 · 3 comments

Comments

@spylogsster
Copy link

There are 2 options and we need to prioritise rules between each other

  1. Redirect IPFS resources to the configured IPFS gateway
  2. Automatically redirect to IPFS pages via DNSLink when possible

If (1) is enabled, we detect /ipfs/{cid} in URL, confirm {cid} is a real CID, and if so, redirect that to ipfs://{cid} (local node) or https://dweb.link/ipfs/{cid} (gateway).
If (2) is enabled, we either do DNSLink lookup for every domain name (only if server returned 5xx error codes), or only if x-ipfs-path is present. If we confirm DNSLink is present (we only care about its presence, not its value), then we redirect to ipns://{example.com} (local node) or https://dweb.link/ipns/{example.com}(gateway), and IPFS node will resolve DNSLink and load the correct data internally.

Test cases:

@spylogsster
Copy link
Author

related issue #21454

@spylogsster spylogsster self-assigned this Mar 7, 2022
@stephendonner
Copy link

cc @MadhaviSeelam

@vadimstruts
Copy link
Collaborator

The IPFS local node and scheme has been deprecated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants