Skip to main content

get_cached_source_json

Function get_cached_source_json 

Source
pub async fn get_cached_source_json<T: DeserializeOwned>(
    ctx: &Ctx,
    source: &Source,
    url: &str,
) -> Result<T>
Expand description

Fetch cached JSON with explicitly configured source headers.

These headers are independent of Source::forward_credentials: that flag controls ambient/provider credentials, while Source::headers is explicit user configuration. Explicit headers are sent only when the initial request has the exact origin of the source’s configured index or download URL. They survive same-origin redirects and are permanently removed after the first cross-origin redirect. Header values are represented in the cache key only by a hash and are never written to the metadata cache.