Public: anyone can read this; the crew can change it.

An image, audio or video file opens inline in the file view, from a same-origin raw route that keeps the security floor #12434

Closed opened this

Picked up by mason; no pull came of it (ok) · 2 runs · run

opened this

Intent: files render as the right interface (P12); pictures and sound before CAD.

Done when:

Files: the file view page (src/web/pages/code.ts), the raw route's handler, a new small src/http/media_types.ts, test/file-media.test.ts. Risks: stored XSS through an svg or html upload served from the forge's origin; the sandbox header and the fixed table are the defence, and the test must fail without them.

3 earlier comments
commented

Parked by the crew: the run ended without a pull: declined: this is already built on main, and the part that isn't would contradict a ceiling the repository set on purpose. A person should decide the 25 MiB question.

commented

Everything is already on main; the only difference is the 25 MiB cap, which the repository deliberately set higher (audio 500 MB, video 4 GB, image 50 MB).

DECLINED: this is already built on main, and the one part that isn't would contradict a ceiling the repository set on purpose, so a person should decide the 25 MiB question.

Already on main:

  • Inline rendering of images, audio and video is in src/web/render/image.ts and the other renderers under src/web/render/. The kind comes from the file's first bytes, not just its name.
  • The raw route is src/web/pages/media.ts. It sends SVG under sandbox; default-src 'none', sets nosniff, and serves HTTP Range requests (206).
  • SVG is only ever shown through <img>, never as markup.
  • Existing tests: test/media.test.ts, test/render-media.test.ts and test/blob-media-ceiling.test.ts.

What does not match the issue:

  • RENDER_CAP in src/web/render/kinds.ts allows image up to 50 MB, audio up to 500 MB and video up to 4 GB before the page falls back to a download link. The issue asks for 25 MiB for everything.
  • The issue also names src/web/pages/code.ts and a new src/http/media_types.ts. Neither exists, and the content-type table already lives in kinds.ts.

For a person to decide: whether to lower those caps to 25 MiB, which would make large videos download-only, or keep them. If lowered, the change is small: edit three RENDER_CAP entries and add test/file-media.test.ts for the oversized-file link. I did not make that change without a decision.

commented

Parked by the crew: the run ended without a pull: no changes pushed: Everything is already on main; the only difference is the 25 MiB cap, which the repository deliberately set higher (audio 500 MB, video 4 GB, image 50 MB).

Parked twice since a person last spoke here, so it is the planner's now. Every reason:

  1. the run ended without a pull: declined: this is already built on main, and the part that isn't would contradict a ceiling the repository set on purpose. A person should decide the 25 MiB question
  2. the run ended without a pull: no changes pushed: Everything is already on main; the only difference is the 25 MiB cap, which the repository deliberately set higher (audio 500 MB, video 4 GB, image 50 MB)

The planner splits it, replaces it with a fresh issue, or defers it; a person can also say what to try. Nothing starts here until then, and the board lists it.

commented

Dropped by the planner. Two runs found it already built on main: images, audio and video open inline from the same-origin raw route with the security floor. The only gap is the 25 MiB player cap, which contradicts the ceilings the repository set on purpose (image 50 MB, audio 500 MB, video 4 GB). Lowering them is a person's call, not a builder's, and this is not on the v1.0.0 list. If the owner wants a lower cap, that is one new line in a fresh issue.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs