def expand_dups(hdr_tuples):
    """
    Given a list of header tuples, unpacks multiple null separated values
    for the same header name.
    """
    out_tuples = list()
    for (n, v) in hdr_tuples:
        for val in v.split('\x00'):
            if len(val) > 0:
                out_tuples.append((n, val))
    return out_tuples