Skip to content

Keep ENS name in the URL when redirecting IPFS and IPNS content#11520

Closed
AlicanC wants to merge 2 commits intoMetaMask:developfrom
AlicanC:develop
Closed

Keep ENS name in the URL when redirecting IPFS and IPNS content#11520
AlicanC wants to merge 2 commits intoMetaMask:developfrom
AlicanC:develop

Conversation

@AlicanC
Copy link
Copy Markdown

@AlicanC AlicanC commented Jul 13, 2021

This is another take on #7740.

When a user visits "myname.eth" what we are doing right now is:

  • Get the contentHash of "myname.eth" from ENS and parse it to get type and hash.
  • If the type is "ipfs-ns" (or "ipns-ns"), redirect to https://[hash].ipfs.gateway (or https://[hash].ipns.gateway).
  • There is no trace of "myname.eth" in the redirected URL so the web app has no way to detect it.

With the changes in this PR, we will instead redirect to https://myname-eth.ipns.gateway/ (for both "ipfs-ns" and "ipns-ns") which will keep the ENS name in the URL. (Resolving myname.eth to its actual "ipfs-ns"/"ipns-ns" content will be done by the gateway for us.)

Manual testing steps:

@AlicanC AlicanC requested a review from a team as a code owner July 13, 2021 22:41
@AlicanC AlicanC requested a review from brad-decker July 13, 2021 22:41
@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Jul 13, 2021

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

@AlicanC AlicanC changed the title Keep domain name when redirecting IPFS and IPNS Keep ENS name in the URL when redirecting IPFS and IPNS Jul 13, 2021
@AlicanC AlicanC changed the title Keep ENS name in the URL when redirecting IPFS and IPNS Keep ENS name in the URL when redirecting IPFS and IPNS content Jul 13, 2021
@AlicanC
Copy link
Copy Markdown
Author

AlicanC commented Jul 13, 2021

I have read the CLA Document and I hereby sign the CLA

@danjm
Copy link
Copy Markdown
Contributor

danjm commented Jul 20, 2021

Thanks for the contribution @AlicanC, we will review soon

@Gudahtt
Copy link
Copy Markdown
Member

Gudahtt commented Jan 10, 2022

Resolving myname.eth to its actual "ipfs-ns"/"ipns-ns" content will be done by the gateway for us.

Interesting - I wasn't aware that this was a thing that IPFS gateways could do. Do you know of any documentation about this feature? Can we expect all or most IPFS gateways to behave similarly?

@AlicanC
Copy link
Copy Markdown
Author

AlicanC commented Jan 13, 2022

Do you know of any documentation about this feature?

Not that I know of. I discovered this by accident.

Can we expect all or most IPFS gateways to behave similarly?

Last time I took a deep dive was months ago but IPFS gateways behaving similarly wasn't a thing in general 😄 I wouldn't depend on it but YMMV.

@brad-decker
Copy link
Copy Markdown
Contributor

@AlicanC has your understanding of this expanded any since your first submission? If there is any documentation about this feature now that you can share that would greatly expedite review process. IF not we will dig in soon. I just updated the PR to see if tests are still green.

@github-actions
Copy link
Copy Markdown
Contributor

This PR has been automatically marked as stale because it has not had recent activity in the last 60 days. It will be closed in 14 days. Thank you for your contributions.

@github-actions github-actions bot added the stale issues and PRs marked as stale label Aug 14, 2023
@github-actions
Copy link
Copy Markdown
Contributor

This PR was closed because there has been no follow up activity in the last 14 days. Thank you for your contributions.

@github-actions github-actions bot closed this Aug 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

stale issues and PRs marked as stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants