Share viewer fails on gateways that ignore range requests

Open
#1,081 2 comments 0 reactions 1 assignee View on GitHub

Maintainers usually reply within 1 day

@BravoNatalie is already working on this.

Since Nov 5, 2026.

Assessment

This issue has not been assessed yet.

Description

Share links by filecoin-pin add --encrypt … --get-share-link cannot be opened in the browser: the v1 viewer (bafkreiarmlzfby6zdf2g6lppopnn2d35mpc2m73thored5w2yy2lfj42ce, the DEFAULT_VIEWER_URL pinned in [[email protected]] requests the envelope from https://.ipfs.inbrowser.link/ with range header, the origin responds 200 with the full body (no content-range), and the viewer gives up with: This share can't be opened in the browser. The server sent the whole encrypted file instead of the parts the Viewer asked for. You can download the encrypted file and decrypt it on your machine.

Image

The share itself is valid: the same link opens fine with filecoin-pin get --share '', and the wrapped key decrypts the stored envelope byte-exact offline. Only the viewer path fails — which makes the default share experience ("send this link to someone without a wallet") broken end to end, since the recipient by definition doesn't have the CLI.

Reproduction (CLI only)

  1. Mint a share link for any small file (calibration or mainnet)
    PRIVATE_KEY= filecoin-pin add --encrypt ./hello.txt --get-share-link
    → prints https://bafkreiarml….ipfs.inbrowser.link/#v1/&d=…&k=fak1_…

  2. Wait for IPNI:
    curl https://cid.contact/cid/ # non-empty ProviderResults

  3. Sanity-check the share is valid:
    filecoin-pin get --share '' ./out # succeeds, restores the file

  4. Open the same link in a browser → the error above.
    The viewer makes exactly one content request:

GET https://.ipfs.inbrowser.link/
Range: bytes=1-327679
← HTTP 200
content-length: 2793983 (entire envelope)
content-range: (absent)
accept-ranges: bytes (advertised, not honored)

No service worker is registered for the content subdomain inside the viewer's browsing context, so the request hits inbrowser.link's server path, which advertises accept-ranges: bytes but ignores range. (Side observation: the same URL returns 403 Forbidden for non-browser user agents, so curl can't reproduce step 4 — it must be a browser.)

Independently verified while diagnosing: IPNI listed the providers, both provider gateways served the envelope (/ipfs/?format=raw → 200), and unwrapWith(T, decodeGrant(d)) + FEE decrypt of the fetched envelope reproduced the plaintext byte-exact. Nothing is wrong with the link, the key, or availability.

Dominant language
TypeScript
Stars
27
Forks
35
Avg merge
1d 13h
Merged PRs (30d)
38

Getting set up

Open in Codespaces

Starts the project's dev container in your browser, under your own GitHub account.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from FilOzone/synapse-sdk

All issues in FilOzone/synapse-sdk

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.