def get_redirect_location(
        self, response: PipelineResponse[Any, AllHttpResponseType]
    ) -> Union[str, None, Literal[False]]:
        """Checks for redirect status code and gets redirect location.

        :param response: The PipelineResponse object
        :type response: ~azure.core.pipeline.PipelineResponse
        :return: Truthy redirect location string if we got a redirect status
         code and valid location. ``None`` if redirect status and no
         location. ``False`` if not a redirect status code.
        :rtype: str or bool or None
        """
        if response.http_response.status_code in [301, 302]:
            if response.http_request.method in [
                "GET",
                "HEAD",
            ]:
                return response.http_response.headers.get("location")
            return False
        if response.http_response.status_code in self._redirect_on_status_codes:
            return response.http_response.headers.get("location")

        return False
Checks for redirect status code and gets redirect location.

        :param response: The PipelineResponse object
        :type response: ~azure.core.pipeline.PipelineResponse
        :return: Truthy redirect location string if we got a redirect status
         code and valid location. ``None`` if redirect status and no
         location. ``False`` if not a redirect status code.
        :rtype: str or bool or None
        
Solutions/CyberArkAudit/Data Connectors/.python_packages/lib/site-packages/azure/core/pipeline/policies/_redirect.py