import warnings


def _log_warnings_postprocess(response):
    """Logs warnings contained within the x-wf-warnings response header."""
    # NOTE: .initial_metadata() will block.
    for key, value in response.initial_metadata():
        if key == "x-wf-warnings":
            warnings.warn(value)

    return response