def METHOD_NAME(self, name: str, port: int = 80,
             headers: Optional[Mapping[str, str]] = None) -> bool:
    """Test whether webserver redirects to secure connection."""
    url = "http://{0}:{1}".format(name, port)
    if headers:
        response = requests.get(url, headers=headers,
                                allow_redirects=False,
                                timeout=_VALIDATION_TIMEOUT)
    else:
        response = requests.get(url, allow_redirects=False,
                                timeout=_VALIDATION_TIMEOUT)
    redirect_location = response.headers.get("location", "")
    # We're checking that the redirect we added behaves correctly.
    # It's okay for some server configuration to redirect to an
    # http URL, as long as it's on some other domain.
    if not redirect_location.startswith("https://"):
        return False
    if response.status_code != 301:
        logger.error("Server did not redirect with permanent code")
        return False
    return True