Skip to content

feat: support dag-json and dag-cbor preview rendering#68

Merged
alanshaw merged 4 commits intomainfrom
feat/support-dag-json-and-cbor
Sep 10, 2025
Merged

feat: support dag-json and dag-cbor preview rendering#68
alanshaw merged 4 commits intomainfrom
feat/support-dag-json-and-cbor

Conversation

@alanshaw
Copy link
Member

@alanshaw alanshaw commented Sep 10, 2025

It's a source of confusion that the Storacha gateway redirects to dweb.link for dag-cbor and dag-json content. This is particularly highlighted when IPNI is down and dweb.link is not able to pull data from our gateway - it appears as though customer data is unavailable. However this is not the case - the data is available over bitswap and via specifying ?format=raw in the querystring but freeway simply does not know how to render a preview HTML page for the data so it responds with 501, causing the redirect behaviour.

This PR adds a preview HTML page for dag-cbor and dag-json that is very similar to the HTML page displayed by ipfs.io and dweb.link for these kinds of data.

Screenshot 2025-09-10 at 15 20 42

I have also updated a few URLs from ipfs.io to ipfs.tech and added an optional parameter to the handlers allowing the gatewayDomain to be set (which ensures resources can be fetched from the same domain as the page is served from).

resolves #28

@alanshaw alanshaw requested a review from a team September 10, 2025 14:35
@alanshaw alanshaw changed the title feat: support dag-json and dag-cbor preview rendering feat: support dag-json and dag-cbor preview rendering Sep 10, 2025
Copy link
Member

@fforbeck fforbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome! Thanks for that!

@alanshaw alanshaw merged commit 19274ec into main Sep 10, 2025
1 check passed
@alanshaw alanshaw deleted the feat/support-dag-json-and-cbor branch September 10, 2025 14:56
alanshaw pushed a commit that referenced this pull request Sep 10, 2025
🤖 I have created a release *beep* *boop*
---


##
[5.2.0](v5.1.3...v5.2.0)
(2025-09-10)


### Features

* support `dag-json` and `dag-cbor` preview rendering
([#68](#68))
([19274ec](19274ec))

---
This PR was generated with [Release
Please](https://github.com/googleapis/release-please). See
[documentation](https://github.com/googleapis/release-please#release-please).

Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement dag-json etc. support

2 participants