async def reverse_proxy(
    iterator: AsyncIterator[bytes],
    chunk_size: int = 5,
) -> AsyncGenerator[bytes, None]:
    """
    A function that will split the data into chunks. This is a mimic of a
    real HTTP reverse proxy that will split the data into chunks.
    """
    async for data in iterator:
        if len(data) > chunk_size:
            while data:
                yield data[:chunk_size]
                data = data[chunk_size:]
        else:
            yield data
A function that will split the data into chunks. This is a mimic of a
real HTTP reverse proxy that will split the data into chunks.
tests/unit/test_utils.py