function resolveMediaDump
resolveMediaDump(
ctx: Context,
dumpId: string
): Promise<{ dump: Dump; cacheControl: string; }>

Returns dump dumpId as the viewer of ctx's ?token= may see it, and the Cache-Control its media get: kept for good under a URL naming the file's current version (?v=, as dumpFileVersion gives), revalidated under any other, and never in a shared cache for a private dump. It also keeps the token out of the Referer of whatever the response links to.

Parameters

ctx: Context
dumpId: string

Return Type

Promise<{ dump: Dump; cacheControl: string; }>

Throws

APIException

400 when dumpId isn't an id, which names files on disk, and 404 when the viewer can't see the dump.

Usage

import { resolveMediaDump } from "api/lib/dump-media.ts";