Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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:// everywhere #93
base: main
Are you sure you want to change the base?
ipfs:// everywhere #93
Changes from 2 commits
489c914
394b0da
c0694c0
3f717c9
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No cigar. Subdomains are how we want people to load websites because content root is aligned with URL root.
Adding this artificial path prefix breaks that alignment and breaks relative paths on every website :(
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My understanding is we want to make sure that content is origin isolated based on CID. We can accomplish that without teaching people how to translate CIDs into origins etc... It is a lot easier to teach programs like gateways to do that, for humans we could just keep
ipfs://${CIDv1}/
regardless of (sub)domain. That gives us:ipfs://${CIDv1}
across all gateways. Reinforcing that${bridge}
in${bridge}ipfs://${CIDv1}
is just a bridge toipfs://${CIDv1}
.You mean sites that use
/images/cat.png
would be broken ? That is a fare point, although I think something that we can overcome by redirecting to/ipfs://{CIDv1}/images/cat.png
based on referrer.Also would not those sites be as broken when loaded from
https://ipfs.io/ipfs/${CIDv1}
now ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Correct. We spent years fixing bugs in various static website generators to support truly relative paths, and it remained a big adoption blocker because there was always a new bug for something new filled.
Only when subdomain gateways got introduced, and the CID root became the root of URL path, all websites and tools started working out-of-the-box with IPFS.
👉 Redirects are transparent in browser context, so your fix will work for a subset of problems like loading images or other assets, but it won't fix websites that execute JS code based on
window.location.pathname
💔Due to this I don't believe this is feasible (creates more problems than it solves).
The best we could do, is to start returning
ipfs://
URIs inLink
header: ipfs/in-web-browsers#179There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That historical context is really helpful! Do you by a chance have a pointers to above JS problems, so it could be quantified and pros and cons could be evaluated.
I realize this is an unfortunate tradeoff. Then I also think that turning
ipfs://{cid}/path/file
intohttps:///${cid}.gateway.tld/path/file
is a cause of why later form is more prominent. I also believe that later form makes it really difficult for an average person to realize that gateway could be swapped.Maybe there is a compromise, that make better tradeoffs ?