INNER CODE UNIT · Python

_hit_headers

redis/fastapi-redis-sdk · src/redis_fastapi/cache.py:477

def _hit_headers(
    stored: list[tuple[str, str]],
    etag: str,
    cc_value: str,
    *,
    not_modified: bool,
) -> list[tuple[bytes, bytes]]:
    """Build the raw header list for a hit, preserving repeated fields.

    Args:
        stored: Header pairs from the entry.
        etag: The stored validator.
        cc_value: ``Cache-Control`` for the entry's remaining TTL.
        not_modified: Whether this is a ``304``, which carries only the
            fields in :data:`NOT_MODIFIED_HEADERS`.

    Returns:
        Raw ASGI header pairs, with the fields this library owns last.

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…