def uncgi_headers(environ):
    """A helper to transform a WSGI environment into a list of headers.

    :param environ: the WSGI environment
    :type environ: dict

    :return: headers
    :rtype: list(tuple(str, str))
    """

    return [
        ("-".join(p.capitalize() for p in k[5:].split("_")), v)
        for k, v in environ.items()
        if k.startswith("HTTP_")
    ]