def convert_header(header):
    """Converts fastapi headers into a dict of strings
    FastAPI comes in as a tuple of byte strings. convert_header turns those headers into a dict of str.
    This is necessary for the JSON marshalling to work.
    """
    res = dict()
    for a, b in header:
        res[a.decode("utf-8")] = b.decode("utf-8")
    return res