(self, host)
Validate a host so it doesn't contain control characters.
Validate a host so it doesn't contain control characters.
Validate a host so it doesn t contain control characters .
def _validate_host(self, host):
        """Validate a host so it doesn't contain control characters."""
        # Prevent CVE-2019-18348.
        match = _contains_disallowed_url_pchar_re.search(host)
        if match:
            raise InvalidURL(f"URL can't contain control characters. {host!r} "
                             f"(found at least {match.group()!r})")
def _validate_host ( self , host ) : # Prevent CVE-2019-18348. match = _contains_disallowed_url_pchar_re . search ( host ) if match : raise InvalidURL ( f"URL can't contain control characters. {host!r} " f"(found at least {match.group()!r})" )