Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

ipfs.files.cat() no longer finds index.html files in directories #1163

Closed
witten opened this issue Dec 21, 2017 · 2 comments
Closed

ipfs.files.cat() no longer finds index.html files in directories #1163

witten opened this issue Dec 21, 2017 · 2 comments

Comments

@witten
Copy link

witten commented Dec 21, 2017

  • 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/ipfs@0.27.3/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.

@daviddias
Copy link
Member

@witten that "feature" was actually a bug that got fixed. A files.cat should not pick up on an index.html, you will need to check it directly.

@witten
Copy link
Author

witten commented Dec 22, 2017

Ah, okay. Thanks for clarifying!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants