Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add flag to ignore index.html resolution in gateway #8265

Open
RangerMauve opened this issue Jul 16, 2021 · 4 comments
Open

Add flag to ignore index.html resolution in gateway #8265

RangerMauve opened this issue Jul 16, 2021 · 4 comments
Labels
effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now topic/gateway Topic gateway

Comments

@RangerMauve
Copy link

At the moment, if I want to do a directory listing using an HTTP request to a gateway, I cannot do anything if there is an index.html file inside a given path.

It would be nice to be able to specify a flag in the querystring (eg, ?noResolve) to skip the resolution of index.html and to do a regular directory read.

This is something I've played with a bit in js-ipfs-fetch using a custom header, but that doesn't play well with CORS and I've since learned that querystrings are much more reliable/ usable (in hypercore-fetch).

Is this something that could be considered for addition?

@RangerMauve RangerMauve added the kind/enhancement A net-new feature or improvement to an existing feature label Jul 16, 2021
@lidel lidel added topic/gateway Topic gateway P2 Medium: Good to have, but can wait until someone steps up effort/hours Estimated to take one or several hours labels Apr 15, 2022
@lidel
Copy link
Member

lidel commented Apr 15, 2022

Notes from triage:

  • sounds useful
  • Food for thought: reuse format: ?format=dir-index-html
    • not sure how to represent it as Accept header (i'd like to have a symmetry similar to car and raw which can be requested both ways)

@lidel lidel added help wanted Seeking public contribution on this issue P3 Low: Not priority right now and removed P2 Medium: Good to have, but can wait until someone steps up labels Apr 15, 2022
@RangerMauve
Copy link
Author

format=dir-index-html seems very specific to how the IPFS gateway currently works. Is it expected that all gateway implementations will use the same HTML rendering behavior whenever index.html rendering is disabled?

For example, in Agregore the default is to render a plain JSON Array of file/subfolder paths and to render an index HTML only if the Accept header says it's taking text/html.

Personally, I'd like to decouple the index.html rendering behavior from whatever the default rendering/indexing functionality is. 😅

Else it'd be nice if we could find a way to standardize the JSON based directory listing thing Agregore does (it's different than downloading the raw DAG-JSON of the directory)

@ivan386
Copy link
Contributor

ivan386 commented Jun 25, 2022

XML directory listing will be useful to.

@Jorropo
Copy link
Contributor

Jorropo commented Jun 25, 2022

XML directory listing will be useful to.

IMO, XML is a pain to deal with, I agree with this but using json and / or cbor.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/hours Estimated to take one or several hours help wanted Seeking public contribution on this issue kind/enhancement A net-new feature or improvement to an existing feature P3 Low: Not priority right now topic/gateway Topic gateway
Projects
None yet
Development

No branches or pull requests

4 participants