IPFS resource on non-IPFS page tries to redirect to https://cid.ipfs.localhost:8080
Jontes-Tech opened this issue · 2 comments
Describe the bug
A clear and concise description of what the bug is.
In chromium, http://localhost:8080/ipfs/cid redirects to https://cid.ipfs.localhost:8080. Kubo's gateway only serves HTTP, not HTTPS.
To Reproduce
Steps to reproduce the behavior:
- Create an HTML (over HTTP) file.
- Create an
<img>
pointing to https://ipfs.io/ipfs/any-cid-here - Image will fail to load because it tries to redirect to https on 8080.
Expected behavior
A clear and concise description of what you expected to happen.
Image loads successfully
Screenshots
If applicable, add screenshots to help explain your problem.
Desktop (please complete the following information):
- OS: Arch Linux
- Browser: Chromium and Google's "Chrome" rebrand
- Version: Latest versions on Chrome Web Store.
@Jontes-Tech I was unable to reproduce in fresh install on Chrome 126.0.6478.36
- Opening http://localhost:3000/ipfs/cid does not redirect to https://cid.ipfs.localhost:8080.
- Bit confused what steps (1) and (2) mean – mind rephrasing? Looks like you've cut some important text.
Yeah, sorry. Github stripped away my HTML tags. I've edited the message to make it clearer.
Basically http://localhost:8080/ipfs/cid should redirect to http://cid.ipfs.localhost:8080 but instead redirects to https://cid.ipfs.localhost:8080 when served as an image in an HTTPS context.
One example of this is present on the following webpage: https://ens.page/jontes.eth
You will see in the network tab how IPFS companion redirects to https:// on localhost.
See the screenshots I've attached:
Reproducible on both Chrome and Chromium, 125.0.6422.141 (Official Build) Arch Linux (64-bit)