-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Gateway: client opt-in JSON responses for directory listing #7552
Comments
Thank you for filling this @lucidNTR – below are my thoughts why we should consider this: On mutability of directory listingsDirectory listing is a special type of response returned by the gateway in that it is generated by the gateway itself. Even for immutable That is why for directories we don't return If we add support for JSON response, then we could truly return an immutable response, instead of less permanent Needs: mandatory versioningThe only concern is that doing plain I think we need to include API version in the request somehow:
so we are able to return clear error when client asks for API response in a version that is no longer supported. Having API version as a part of request would also let us return proper cache control headers that mark response as immutable under TLDR: this would be useful featurePersonally, I would be open to a PR that adds this feature, as long versioning is mandatory. |
@lidel I'm generally fine if we want to basically alias something we already do (e.g. A couple thoughts + questions though:
|
|
SGTM then.
I assume this is true even if we keep utilizing accept headers but that particular combination is no longer supported, right? |
Yes, the value of |
Note to self: if we enable this via |
#8234 could be relevant here:
Going with dag-cbor representation not only solves versioning, but makes it possible to programmatically traverse unixfs |
Followup to #7431, that was closed but had the valuable feature of accessing json manifest of folder
requests to a "folder", especially the root of a folder published to ipns such as http://bafzbeibxww7y6v5metkgmxeqkvls74uqvptbhommrb5b7xianigcicdvuy.ipns.localhost/
should be served the same response as
https://ipfs.io/api/v0/ls?arg=bafzbeibxww7y6v5metkgmxeqkvls74uqvptbhommrb5b7xianigcicdvuy
IF the accept content type header is set to "application/json" that way there is no interference with existing gateway behaviour and with serving the index.html file at the root
The text was updated successfully, but these errors were encountered: