ipfs.files.cat() no longer finds index.html files in directories #1163
Description
- Version: 0.27.5 and 0.27.4
- Platform:
Linux flux 4.2.0-23-generic #28~14.04.1-Ubuntu SMP Thu Dec 31 13:40:42 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux
(Firefox 57.0.1) - Subsystem:
core/components
?
Type: Bug
Severity: High
Description:
In previous versions of js-ipfs (0.27.2 for instance), you could ipfs.files.cat()
a web page "directory" path stored on IPFS, and it would retrieve any index.html page stored there. For instance, see this page on the gateway an example: https://gateway.ipfs.io/ipfs/QmTeW79w7QQ6Npa3b1d5tANreCDxF2iDaAPsDvW6KtLmfB/docs/examples/
In newer versions of js-ipfs (0.27.4 and 0.27.5), cat()
ing such a path results in Error: No such file
. I imagine this is a regression introduced by 120d291
Steps to reproduce the error:
Save this example repro index.html file, and then open it in your browser: https://gist.githubusercontent.com/witten/00f9eda2272a48f5f3ee602e09596e46/raw/3da247b9825e01b3bc836af3bb896c3f945069f8/index.html
Open your browser console and observe the Error: No such file
. It may take a few second to load the first time.
Then, edit the file and change the first <script src>
from https://unpkg.com/ipfs/dist/index.js
to https://unpkg.com/[email protected]/dist/index.js
. Reload the page, and note that by rolling back the js-ipfs version, you've "fixed" the regression, and the HTML of the page in question spews to the console.