-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
IPFS badge broken on public gateways #14657
Comments
@lidel yes, looks good, thanks for detailed clarification |
@lidel what about 5xx when we resolve dnslink record? |
@spylogsster for DNSLink websites we always want human-readable |
Verified
case 1
Verified that the anchor went to the right place in the viewport case 2
Verified that the anchor went to the right place in the viewport case 3
Verified that the anchor went to the right place in the viewport case 4
Verified that the anchor went to the right place in the viewport case 5
Verified that the anchor went to the right place in the viewport case 6
Verified that the anchor went to the right place in the viewport
|
Removing Android label for now as we don't have option to load pages via local node cc: @bbondy |
People visiting a random public gateway should be able to open resources via their own node to ensure the integrity of downloaded data. Unfortunately it does not work yet: the badge is broken on gateways in 1.23.32 (nightly).
How to Reproduce
https://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi.ipfs.cf-ipfs.com/ shows:
Clicking on a badge opens an invalid URI:
(expected behavior in this case is to open
ipfs://bafybeigdyrzt5sfp7udm7hu76uh7y26nf3efuylqabf3oclgtqy55fbzdi
)Underlying problem
I know we have a simple situation for DNSLink websites: when
x-ipfs-path
is present we swap the protocol fromhttps
toipns
and call it a day.Unfortunately this does not work for non-DNSLink resources such as gateways.
I think we focused on DNSLink pages so much that we never discussed how non-DNSLink contexts like public gateways should be handled.
We need to ensure a reverse transformation to what is described in addressing guideline happens when the user clicks on the badge.
Proposed fix
For the sake of reducing complexity and future-proofing, Brave could tweak the badge logic to make things work on all types of gateways (path, subdomain, dnslink):
x-ipfs-path
header://
?queries
or#fragments
present in the original URLTo illustrate, assuming URL in address bar is
https://{something}?query#fragment
and HTTP response hasx-ipfs-path
header, thex-ipfs-path value
→URI of tab to open after clicking on the badge
mapping could look like this:/ipfs/{cid}/path
→ipfs://{cid}/path?query#fragment
/ipns/{libp2p-key}/path
→ipns://{libp2p-key}/path?query#fragment
/ipns/{dnslink-fqdn}/path
→ipns://{dnslink-name}/path?query#fragment
{dns-safe-fqdn}
because{dnslink-fqdn}
in the header is already correct.@spylogsster does this sound feasible?
The text was updated successfully, but these errors were encountered: