Closed bug report

Share links: readme.html loads but its images, videos and PDFs 404 (no cap for share visitors)

John Lauer · ·closed by Colby Knox

Since the share-cookie change (2026-10-30), a share link opens a private page's readme.html for a signed-out visitor, but none of the page's own files load inside it: every image, video and PDF the readme references returns 404. Signed-in viewers see the same page with all its media, because their readme frame gets a cap.

Repro (john/adom-investor-deck-series-a, share 21), curl with a fresh cookie jar, no Adom session:

  1. GET /john/adom-investor-deck-series-a?share=<token>: 302, Set-Cookie: wiki_share=21~..., then 200. Good.
  2. The page's iframe is /readme/john/app/adom-investor-deck-series-a?variant=public, with no cap= (a signed-in viewer gets ?variant=public&cap=<cap> and window.__wikiCap in the frame).
  3. With the wiki_share cookie, every file route answers 404 PAGE_NOT_FOUND:
    • /api/pages/john/adom-investor-deck-series-a/files/media/acb-film.mp4
    • /john/adom-investor-deck-series-a/render/media/acb-film.mp4
    • /blob/app/adom-investor-deck-series-a/media/acb-film.mp4
    • /api/pages/.../files/img/floor.jpg?share=<token> (token as a query parameter): also 404.

The readme frame is sandboxed without allow-same-origin, so the cookie may not ride its subresource requests anyway; the cap is the only thing that can work there.

Expected: when the page is opened through an active share whose scope includes the overview, the readme frame gets a cap (as for a signed-in reader) that the files API accepts for that page's files, for the life of the share.

Impact: the shared readme.html renders with blank photos, dead video players and a broken PDF download for every share recipient. Related: #250 (render route 404s with the share cookie).

5 Replies

Colby Knox ·

Fixed and live on prod (b10bb500).

The readme frame (and a readme.html opened through /render/) is sandboxed, so its pictures, videos and PDFs never carried your share cookie, and only signed-in readers got a cap. A share visitor's frame now gets a share cap: it reads window.__wikiCap and its media URLs get ?cap= the same way a signed-in reader's do.

A share cap acts exactly like the link that issued it. On an overview-only link it opens the files the readme references and nothing else. It stops working when the link is revoked or expires, and it never opens another page.

Checked on staging with an overview-only link: the frame and its referenced files load, and unreferenced files still return 404. Reopen this if your investor deck still shows blank media.

John Lauer ·

Thanks, the share cap is there now, but on john/adom-investor-deck-series-a (share 21, overview only) it opens only readme.html and README.md. Every image and video still answers 404, including files the readme names literally.

Checked 2026-10-30 ~16:30 Central, curl with a fresh cookie jar, cap taken from the frame's var CAP="s.764160...":

  • /api/pages/john/adom-investor-deck-series-a/files/readme.html?cap=<cap>: 200
  • /api/pages/john/adom-investor-deck-series-a/files/README.md?cap=<cap>: 200
  • /api/pages/john/adom-investor-deck-series-a/files/img/floor.jpg?cap=<cap>: 404 (readme has src="img/floor.jpg")
  • .../files/media/teaser.jpg?cap=<cap>: 404 (readme has poster="media/teaser.jpg")
  • .../files/media/acb-film.mp4?cap=<cap>: 404
  • same 404s on /john/<slug>/render/<path>, /readme/john/app/<slug>/<path> and /blob/app/<slug>/<path>

Re-pushing readme.html after the deploy did not change it. Also seen in a real Chrome incognito window: the deck text renders, the media does not.

Most of the deck's media is also referenced through data-src and built in script, so a literal-reference scan would miss those even once it works. Could an overview-only share cap cover every file under the page except dot/config files, or honor a list declared in page.json (for example share_assets: ["img/", "media/", "*.pdf"])?

Colby Knox ·

Thanks for the detail. You found two things.

The bug, fixed in 932f3bba (on staging now, prod with the next tag): the overview-only link only recognized references written as full file URLs. Your readme uses relative ones (src="img/floor.jpg", poster="media/teaser.jpg"), so even files it names literally answered 404. Now any quoted string in the readme that names a file in the page counts, read relative to the readme's folder. That covers src, poster, a literal data-src, and a file name written as a string in a script.

Related, in the same change: a relative path inside the page's embedded readme frame resolved to a URL nothing serves, for everyone. The frame now points relative paths at the page's /render/ route, the same way they resolve when you open /render/readme.html.

What a scan can't see: a name your script builds ("media/" + name + ".mp4") isn't in the readme's text. For those, declare the folders in page.json:

"share_assets": ["img/", "media/", "*.pdf"]

Overview-only links then also read those files. An entry ending in / is a folder, a bare name like *.pdf matches in any folder, and * stays within one folder level. Dot files and raw design source are never included, even inside a listed folder.

Until the tag, you can switch these links to whole-page in place; the URLs stay the same.

Colby Knox ·

@john can this be closed?

Colby Knox ·

Closing this. Everything from the thread is on prod: the share cap for the readme frame (b10bb500), and relative references, literal data-src and page.json share_assets (932f3bba). The tests cover an overview-only link loading media named by relative path, data-src, and share_assets folders, while unlisted files still return 404.

For media your script builds by name, add the folders to page.json, for example "share_assets": ["img/", "media/", "*.pdf"]. If the investor deck still shows blank media through a share link, reopen this and I'll look at that page.

Colby Knox closed this ·

Log in to reply.