-
Notifications
You must be signed in to change notification settings - Fork 13
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
fix: ipfs-hosted redirects are not infinite #215
Conversation
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.
Thanks! Had no bandwidth today to review code, but if this data point is useful: I did run it locally against static http server and ?helia-sw=/ipns/docs.ipfs.tech
and it no longer redirects to /ipns/docs.ipfs.tech
so the infinite loop from #211 (comment) does not occur anymore.
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.
self review
await $(execaOptions)`${kuboBin} config Addresses.Gateway /ip4/127.0.0.1/tcp/${gatewayPort}` | ||
await $(execaOptions)`${kuboBin} config Addresses.API /ip4/127.0.0.1/tcp/0` | ||
await $(execaOptions)`${kuboBin} config --json Bootstrap ${JSON.stringify([])}` | ||
await $(execaOptions)`${kuboBin} config --json Swarm.DisableNatPortMap true` | ||
await $(execaOptions)`${kuboBin} config --json Discovery.MDNS.Enabled false` | ||
await $(execaOptions)`${kuboBin} config --json Gateway.NoFetch true` | ||
await $(execaOptions)`${kuboBin} config --json Gateway.DeserializedResponses true` | ||
await $(execaOptions)`${kuboBin} config --json Gateway.ExposeRoutingAPI false` | ||
await $(execaOptions)`${kuboBin} config --json Gateway.HTTPHeaders.Access-Control-Allow-Origin ${JSON.stringify(['*'])}` | ||
await $(execaOptions)`${kuboBin} config --json Gateway.HTTPHeaders.Access-Control-Allow-Methods ${JSON.stringify(['GET', 'POST', 'PUT', 'OPTIONS'])}` |
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.
The http-server hosted scenarios seemed fine. The _redirects logic with the newer |
merging to fix the bug on https://inbrowser.dev |
Title
fix: ipfs-hosted redirects are not infinite
Description
Fixes #211
Summary of changes
ipfs-hosted
tests in first-hit.test.ts to use the above test server, so we are no longer only getting a ?helia-sw request. This should get us 99% closer to actual functionality when hosted in environments like inbrowser.tldsrc/pages/redirects-interstitial.tsx
andsrc/pages/redirect-page.tsx
but it's not actually working for some reasonNotes & open questions
I could use an extra set of eyes on the updated use of @libp2p/logger in reverse-proxy.jsproxy-server logging fixed with688594e
(#215)RedirectsInterstitial
because it's just going to be quick Flashes that aren't really visible, but on gateways where providing the assets are slow, it will be informative.Demo showing fix:
2024-04-23.at.10.20.59.-.ipfs-hosted-redirect.mp4
Change checklist