ipshipyard / waterworks-community

Discussion and documentation concerning the operation of the Public Goods for IPFS and Libp2p.
https://docs.ipfs.tech/concepts/public-utilities/
MIT License
2 stars 1 forks source link

https://dweb.link/ip[f|n]s/?uri= handler is broken #11

Closed lidel closed 7 months ago

lidel commented 9 months ago

?uri= router (specs) used in some browser contexts is broken, probably due to bad bits trying to parse ?uri= as identifier:

https://dweb.link/ipfs/?uri=ipfs%3A%2F%2Fbafybeicojl6bm5fa5lxr4fluhdsc2lhj5nkanb5vo4dg7vjdiwbkhgy5qu

2024-02-07_23-23

@ns4plabs if I got this right, a potential fix is to bypass badbits for requests to paths that start with, and let rainbow handle them:

It is safe to do as these will redirect to proper subdomain where bad bits will be correctly applied:

$ curl "http://localhost:8080/?uri=ipfs%3A%2F%2Fbafybeicojl6bm5fa5lxr4fluhdsc2lhj5nkanb5vo4dg7vjdiwbkhgy5qu" -i
HTTP/1.1 301 Moved Permanently
Content-Type: text/html; charset=utf-8
Location: /ipfs/bafybeicojl6bm5fa5lxr4fluhdsc2lhj5nkanb5vo4dg7vjdiwbkhgy5qu
Date: Wed, 07 Feb 2024 22:26:53 GMT
Content-Length: 100

<a href="/ipfs/bafybeicojl6bm5fa5lxr4fluhdsc2lhj5nkanb5vo4dg7vjdiwbkhgy5qu">Moved Permanently</a>.