Media / foldkit-media/server

factsOf

function · packages/media/src/server/facts.ts:40

function factsOf(
  url: string,
  options: FactsOptions,
): Effect.Effect<ImageAsset, FactsUnavailable, Inspector>

The facts of an image a page names only by URL (a rich-text image, a CMS block), so it is drawn with its box and placeholder like any other: its original read from an allowed host and described (describe), with the URL as its key. Only https on a host in allow is read, and every redirect is checked again, so content cannot point the build at an internal address. Kept in cache, an unchanged original is asked for with its ETag and not read or inspected again.