Closed SgtPooki closed 2 months ago
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.
The http-server hosted scenarios seemed fine. The _redirects logic with the newer redirects-interstitial.jsx
page introduced the bug. This is why I had to implement local ipfs-gateway.js
so that we could serve the site similarly to inbrowser.tld
.
merging to fix the bug on https://inbrowser.dev
Title
fix: ipfs-hosted redirects are not infinite
Description
Fixes https://github.com/ipfs-shipyard/service-worker-gateway/issues/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:
https://github.com/ipfs-shipyard/service-worker-gateway/assets/1173416/d06ebbd5-1270-4a21-9e5f-ba6a8f870791
Change checklist